Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

mb_strlen (php) for ASP

Question posted by: =?Utf-8?B?c3NyOTI=?= (Guest) on July 10th, 2008 07:05 PM
Hi,
I need to a function that performs the same task than mb_strlen (in php)?
Any help ?


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 10th, 2008
07:45 PM
#2

Re: mb_strlen (php) for ASP
First of all, ASP isn't a language. So it doesn't have *ANY* coding functions.

You code ASP in either VBScript or JScript (or, if you can find a copy from
7 or 8 years ago, PerlScript).

In either VBScript or JScript, though, the question is a non-sequitir.

The PHP function mb_strlen is for use with Multi-Byte strings (e.g., UTF-8)
and neither VBS nor JS suport them. Both use *ONLY* Unicode strings (that
is, where each character is *ALWAYS* two bytes long). So the standard string
length functions would always give you the same answer that mb_strlen( )
would give you, if it were applicable.

vbscript: LEN(str)
JScript: str.length

NOTE: VBScript *does* allow you to get the length of a string in bytes,
using
LENB(str)
but it's always 2 * LEN(str) so not useful in determining how many 2-byte
UTF-8 characters there would be in the string if you could convert it to
UTF-8.



 
Not the answer you were looking for? Post your question . . .
182,317 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors