php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45417 strlen count wrong with accented characters
Submitted: 2008-07-02 14:35 UTC Modified: 2008-07-02 14:36 UTC
From: ponton dot leo at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.6 OS: xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ponton dot leo at gmail dot com
New email:
PHP Version: OS:

 

 [2008-07-02 14:35 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-02 14:36 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 09:01:34 2025 UTC