#49528 [NEW]: UTF-16 strings prefixed by BOMs wrondly converted
| From: | moriyoshi@php.net | Date: | Fri, 11 Sep 2009 07:45:05 +0000 |
| Subject: | #49528 [NEW]: UTF-16 strings prefixed by BOMs wrondly converted | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-142243@lists.php.net to get a copy of this message | ||
From: moriyoshi@php.net
Operating system: N/A
PHP version: 5.3SVN-2009-09-11 (SVN)
PHP Bug Type: mbstring related
Bug description: UTF-16 strings prefixed by BOMs wrondly converted
Description:
------------
The first character of a UTF-16 string prefixed by "\xff\xfe" (LE BOM)
gets converted to wrong Unicode codepoint. Moreover, the resulting string
contains the BOM itself while it is uncalled for.
Reproduce code:
---------------
<?php
var_dump(bin2hex(mb_convert_encoding("\xff\xfe\x01\x02\x03\x04", "UCS-2",
"UTF-16")));
?>
Expected result:
----------------
string(8) "02010403"
Actual result:
--------------
string(12) "feffff010403"
--
Edit bug report at http://bugs.php.net/?id=49528&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49528&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49528&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49528&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49528&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49528&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49528&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49528&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49528&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49528&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49528&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49528&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49528&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49528&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49528&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49528&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49528&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49528&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49528&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49528&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49528&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49528&r=mysqlcfg