|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67276 mb_strwidth count combining chars
Submitted: 2014-05-14 13:41 UTC Modified: 2018-03-11 14:41 UTC
From: nicolas dot grekas+php at gmail dot com Assigned:
Status: Open Package: mbstring related
PHP Version: 5.5.12 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-05-14 13:41 UTC] nicolas dot grekas+php at gmail dot com
combining characters should account for zero width when counted with mb_strwidth.

Test script:

$a = 'é';

echo mb_strwidth($a, 'utf8'), "\n";

$b = Normalizer::normalize($a, Normalizer::NFD);

echo mb_strwidth($b, 'utf8'), "\n";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-11 14:41 UTC]
Not sure if this is a bug or rather a feature request.  Anyhow, I
guess it won't be fixed, since mbfl has no notion of combining
characters, generally, and the grapheme_*() functions already
cater to that.  Furthermore, mb_strwidth() appears to be useful
for monospaced fonts only.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 11:01:24 2021 UTC