mb_strlen (php) for ASP

S

ssr92

Hi,
I need to a function that performs the same task than mb_strlen (in php)?
Any help ?
 
O

Old Pedant

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top