From: areid at lumerical dot com Operating system: RHEL5 PHP version: 5.2.6 PHP Bug Type: mbstring related Bug description: mb_check_encoding returns wrong result when using iso-2022-jp character set
Description: ------------ The mb_check_encoding function returns false when a particular Japanese character is used with the iso-2022-jp character set. The offending character has hex code 2d6a. This is a special character representing "incorporated". The character itself does not seem to be in the JIS X 0208-1983 character table, but most windows applications seem to recognize it (Outlook, Firefox, Explorer, etc). In this particular case, the original text was composed in Outlook. Reproduce code: --------------- //This is valid iso-2022-jp code for //this single Japanese character representing incorporated $txt = "\x1b\x24\x42\x2d\x6a"; //The output of the below code will be "bad encoding" if(mb_check_encoding($txt,'ISO-2022-JP')){ echo 'good encoding'; }else{ echo 'bad encoding'; Expected result: ---------------- "good encoding" should be printed Actual result: -------------- "bad encoding" is printed -- Edit bug report at http://bugs.php.net/?id=46131&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46131&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46131&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46131&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46131&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=46131&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46131&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46131&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46131&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46131&r=support Expected behavior: http://bugs.php.net/fix.php?id=46131&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46131&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46131&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46131&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46131&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46131&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46131&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46131&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46131&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46131&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46131&r=mysqlcfg