ID:               45993
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mtrojan at transline dot de
-Status:           Open
+Status:           Assigned
 Bug Type:         mbstring related
 Operating System: Windows XP
 PHP Version:      5.2.6
-Assigned To:      
+Assigned To:      hirokawa
 New Comment:

Assigned to the mbstring maintainer.


Previous Comments:
------------------------------------------------------------------------

[2008-09-04 11:47:39] mtrojan at transline dot de

Description:
------------
mb_detect_encoding does not seem to recognize UTF-16 encoded files
properly. Even if it is assured by using mb_check_encoding that a file
is truly UTF-16LE, mb_detect_encoding does not detect the same file as
UTF-16 and is returning ISO-8859-1 instead. Activating/deactivating
strict mode has no influence on the result.

Reproduce code:
---------------
$content = file_get_contents($src_path);
        
$encodings = array('UTF-16', 'UTF-16LE', 'UTF-16BE', 'UTF-8',
'UNICODE', 'ISO-8859-1');

$enc = mb_detect_encoding($content, $encodings);
print "encoding: $enc\n";
        
print 'checked: ' . intval(mb_check_encoding($content, 'UTF-16LE'));

Expected result:
----------------
encoding: UTF-16LE
checked: 1

Actual result:
--------------
encoding: ISO-8859-1
checked: 1


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45993&edit=1

Reply via email to