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

From: Date: Mon, 15 Jun 2015 16:03:29 +0000
Subject: Bug #69840 [NEW]: iconv_substr() doesn't work with UTF-16BE
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193515@lists.php.net to get a copy of this message
From:             jan dot slabon at setasign dot com
Operating system: Windows 7 Pro
PHP version:      7.0.0alpha1
Package:          ICONV related
Bug Type:         Bug
Bug description:iconv_substr() doesn't work with UTF-16BE

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 bug report at https://bugs.php.net/bug.php?id=69840&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69840&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69840&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69840&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69840&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69840&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69840&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69840&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69840&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69840&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69840&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69840&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69840&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69840&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69840&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69840&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69840&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69840&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69840&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69840&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69840&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#193515) next »