|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-06-25 06:16 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
Oh it makes no different ! echo mb_strlen('A'); // returns 1 echo mb_strlen('ب'); //returns 2You have to specify the correct encoding. eg. mb_internal_encoding("UTF-8"); echo mb_strlen('ﺏ');