Bug #47990 [Com]: mb_check_encoding() accepts surrogates for UTF-8

From: Date: Wed, 18 Jan 2012 08:53:20 +0000
Subject: Bug #47990 [Com]: mb_check_encoding() accepts surrogates for UTF-8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166570@lists.php.net to get a copy of this message
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

« previous php.bugs (#166570) next »