Edit report at https://bugs.php.net/bug.php?id=47990&edit=1
ID: 47990 Comment by: deceze at gmail dot com Reported by: mercator+bugs at gmail dot com Summary: mb_check_encoding() accepts surrogates for UTF-8 Status: Assigned Type: Bug Package: mbstring related Operating System: Windows XP PHP Version: 5.2.9 Assigned To: moriyoshi Block user comment: N Private report: N New Comment: This seems to be fixed in PHP 5.3, it returns false as expected. Close? Previous Comments: ------------------------------------------------------------------------ [2009-04-16 15:53:35] mercator+bugs at gmail dot com Description: ------------ mb_check_encoding() wrongly considers surrogates (Unicode range U+D800 - U+DFFF) to be valid for the UTF-8 encoding. Reproduce code: --------------- var_dump(mb_check_encoding("\xed\xa0\x80",'UTF-8')); Expected result: ---------------- bool(false) Actual result: -------------- bool(true) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=47990&edit=1