Bug #79308 [NEW]: Unexpected length of unicode string returned
From: dpiekarski at dompie dot de
Operating system: Ubuntu 18.04.4 LTS
PHP version: 7.4.3
Package: *Unicode Issues
Bug Type: Bug
Bug description:Unexpected length of unicode string returned
Description:
------------
Getting the grapheme_strlen() of the string 'नमसà¥à¤¤à¥' returns
3 instead of expecting 4.
ICU version 65.1
ICU Data version 65.1
ICU TZData version 2019c
ICU Unicode version 12.1
iconv library version => 2.27
On another system (Debian 10) with PHP7.3 and
ICU version => 63.1
ICU Data version => 63.1
ICU TZData version => 2018e
ICU Unicode version => 11.0
iconv library version => 2.28
it works as expected.
Test script:
---------------
<?php
$word = 'नमसà¥à¤¤à¥';
var_dump(grapheme_strlen($word));
Expected result:
----------------
int(4)
Actual result:
--------------
int(3)
--
Edit bug report at https://bugs.php.net/bug.php?id=79308&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79308&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79308&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79308&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79308&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79308&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79308&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79308&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79308&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79308&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79308&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79308&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79308&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79308&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79308&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79308&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79308&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79308&r=mysqlcfg
Thread (4 messages)
- dpiekarski at dompie dot de