#45417 [Opn->Bgs]: strlen count wrong with accented characters

From: Date: Wed, 02 Jul 2008 14:36:49 +0000
Subject: #45417 [Opn->Bgs]: strlen count wrong with accented characters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-126206@lists.php.net to get a copy of this message
ID: 45417 Updated by: derick@php.net Reported By: ponton dot leo at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: xp PHP Version: 5.2.6 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Use mb_strlen() or wait for PHP 6. Previous Comments: ------------------------------------------------------------------------ [2008-07-02 14:35:24] ponton dot leo at gmail dot com Description: ------------ I realize there have been similar bug reports to this. I can see why the miscount occurs, but feel that either the returned count should be true (string length) or the manual should warn that the count is apparent (byte length). Therefore, the problem is either function or documentation. Reproduce code: --------------- echo strlen('ñ'); Expected result: ---------------- expect 1 Actual result: -------------- get 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45417&edit=1

« previous php.bugs (#126206) next »