Bug #69840 [Opn->Ver]: iconv_substr() doesn't work with UTF-16BE
Edit report at https://bugs.php.net/bug.php?id=69840&edit=1
ID: 69840
Updated by: cmb@php.net
Reported by: jan dot slabon at setasign dot com
Summary: iconv_substr() doesn't work with UTF-16BE
-Status: Open
+Status: Verified
Type: Bug
Package: ICONV related
Operating System: Windows 7 Pro
PHP Version: 7.0.0alpha1
Block user comment: N
Private report: N
New Comment:
Confirmed: <http://3v4l.org/C9im4>.
Previous Comments:
------------------------------------------------------------------------
[2015-06-15 16:03:28] jan dot slabon at setasign dot com
Description:
------------
The iconv_substr() function returns false instead of the expected substring.
I just tried UTF-16LE which works:
php -r "var_dump(iconv_substr(\"a\x00b\x00\", 0, 1, 'UTF-16LE'));"
string(2) "a\x00"
Also iconv_strlen() works as expected.
Test script:
---------------
var_dump(iconv_substr("\x00a\x00b", 0, 1, 'UTF-16BE'));
Expected result:
----------------
string(2) "\x00a"
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69840&edit=1
Thread (5 messages)