On Wed, 21 Mar 2007 10:50:26 +0530
Anirudh Zala <[EMAIL PROTECTED]> wrote:

> Hello Everybody,
> 
> While building a truly multilingual project, I am running into an interesting 
> problem with php5 + utf-8 + mb_string.
<snip>
> ____________  = 1 word; 4 bytes; 2 characters (______, ______); 4 key-strokes 
> (___, ___, ___, ___); 
> "strlen" should be 2 but is 4.

Generally the libc-like functions exhibit libc behavior so 4 is the
correct answer.

Is mb_strlen not suitable for some reason? You have to use mb_* functions
whenever you perform character-wise operations as opposed to byte-wise
(and that assumes you're running in the UTF-8 locale).

Mike

-- 
Michael B Allen
PHP Active Directory Kerberos SSO
http://www.ioplex.com/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to