Bug #51563 [Opn->Asn]: Incorrect result
Edit report at http://bugs.php.net/bug.php?id=51563&edit=1
ID: 51563
Updated by: felipe@php.net
Reported by: zdenis at free dot fr
Summary: Incorrect result
-Status: Open
+Status: Assigned
Type: Bug
Package: mbstring related
Operating System: Windows
PHP Version: 5.3.2
-Assigned To:
+Assigned To: moriyoshi
Previous Comments:
------------------------------------------------------------------------
[2010-04-15 16:06:23] zdenis at free dot fr
Description:
------------
When using mb_detect_encoding, depending on how many é characters - or
any character above 127 - are present in the string, the detected
charset is not consistent and then sometimes wrong.
Test script:
---------------
// little example
php -r "echo mb_detect_encoding(\"é\", 'UTF-8,ISO-8859-1');"
php -r "echo mb_detect_encoding(\"éé\", 'UTF-8,ISO-8859-1');"
// real life example
php -r "echo mb_detect_encoding(\"Produit commandé\",
'UTF-8,ISO-8859-1');"
php -r "echo mb_detect_encoding(\"Société\",
'UTF-8,ISO-8859-1');"
Expected result:
----------------
ISO-8859-1
ISO-8859-1
ISO-8859-1
ISO-8859-1
Actual result:
--------------
UTF-8
ISO-8859-1
UTF-8
ISO-8859-1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51563&edit=1
Thread (6 messages)