Bug #69840 [Csd->Ver]: iconv_substr() doesn't work with UTF-16BE

From: Date: Wed, 17 Jun 2015 07:40:34 +0000
Subject: Bug #69840 [Csd->Ver]: iconv_substr() doesn't work with UTF-16BE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193592@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69840&edit=1

 ID:                 69840
 Updated by:         kalle@php.net
 Reported by:        jan dot slabon at setasign dot com
 Summary:            iconv_substr() doesn't work with UTF-16BE
-Status:             Closed
+Status:             Verified
 Type:               Bug
 Package:            ICONV related
 Operating System:   Windows 7 Pro
 PHP Version:        7.0.0alpha1
-Assigned To:        
+Assigned To:        kalle
 Block user comment: N
 Private report:     N

 New Comment:

Should be fixed and available in Alpha 2


Previous Comments:
------------------------------------------------------------------------
[2015-06-17 07:40:04] kalle@php.net

Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ff9e290438afc4c9e3d69bc88e37fd56267fe898
Log: Fixed bug #69840 (iconv_substr() doesn't work with UTF-16BE)

------------------------------------------------------------------------
[2015-06-15 21:44:43] cmb@php.net

Confirmed: <http://3v4l.org/C9im4>.

------------------------------------------------------------------------
[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)

« previous php.bugs (#193592) next »