Bug #79308 [NEW]: Unexpected length of unicode string returned

From: Date: Wed, 26 Feb 2020 12:50:26 +0000
Subject: Bug #79308 [NEW]: Unexpected length of unicode string returned
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225732@lists.php.net to get a copy of this message
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)

« previous php.bugs (#225732) next »