Edit report at https://bugs.php.net/bug.php?id=65117&edit=1

 ID:                 65117
 Updated by:         ras...@php.net
 Reported by:        afarahmand1992 at gmail dot com
 Summary:            problem in returning
 Status:             Not a bug
 Type:               Bug
 Package:            *Unicode Issues
 Operating System:   Windows
 PHP Version:        5.4Git-2013-06-25 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

You have to specify the correct encoding. eg.

mb_internal_encoding("UTF-8");
echo mb_strlen('ﺏ');


Previous Comments:
------------------------------------------------------------------------
[2013-06-25 06:33:00] afarahmand1992 at gmail dot com

Oh it makes no different !

echo mb_strlen('A');
// returns 1

echo mb_strlen('ب');
//returns 2

------------------------------------------------------------------------
[2013-06-25 06:28:40] afarahmand1992 at gmail dot com

thank you Rasmus
This is my issue 
And I can't believe that "You" answered me :)

------------------------------------------------------------------------
[2013-06-25 06:23:57] ras...@php.net

See mb_strlen()

------------------------------------------------------------------------
[2013-06-25 06:16:18] afarahmand1992 at gmail dot com

Description:
------------
Hi
As you know , ANSI string length is equal to each character,
But in Unicode string (UTF-8) each character returns twice!
And for checking string that can be ANSI or UTF-8 we can't get the real 
length using strlen() !

What should we do?
I think it had better improve the strlen() function to check
the Unicode/ANSI String before return the length 



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65117&edit=1

Reply via email to