From: FrancS at seznam dot cz Operating system: Windows XP PHP version: 5.2.9 PHP Bug Type: mbstring related Bug description: Wrong mb_detect_encoding() with string "chráany"
Description:
------------
Hi,
today I discover a problem with mb function mb_detect_encoding().
I have a string "chráany" in czech language. It seems that this function
everytime return UTF-8 encoding, even if I load the text from a file with
encoding "windows-1250" or "ISO-8859-2".
Reproduce code:
---------------
// test.txt is text file with charset "windows-1250" or "ISO-8859-2"
$string = file_get_contents('test.txt');
var_dump(mb_detect_encoding($string, mb_list_encodings(), true));
Expected result:
----------------
SJIS
Actual result:
--------------
utf-8
--
Edit bug report at http://bugs.php.net/?id=47876&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47876&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47876&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47876&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47876&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47876&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47876&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47876&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47876&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47876&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47876&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47876&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47876&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47876&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47876&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47876&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47876&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47876&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47876&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47876&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47876&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47876&r=mysqlcfg
