#41147 [Opn->Fbk]: mb_check_encoding fails to check invalid string
| From: | tony2001@php.net | Date: | Fri, 20 Apr 2007 09:27:45 +0000 |
| Subject: | #41147 [Opn->Fbk]: mb_check_encoding fails to check invalid string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111725@lists.php.net to get a copy of this message | ||
ID: 41147
Updated by: tony2001@php.net
Reported By: teracci2002 at yahoo dot co dot jp
-Status: Open
+Status: Feedback
Bug Type: mbstring related
Operating System: Linux
PHP Version: 5.2.1
New Comment:
Please explain why do you think it should succeed if the data is
invalid.
Previous Comments:
------------------------------------------------------------------------
[2007-04-20 09:21:42] teracci2002 at yahoo dot co dot jp
Description:
------------
mb_check_encoding returns true when specific invalid EUC-JP / Shift_JIS
/ UTF-8 char sequence supplied.
Reproduce code:
---------------
//(1)
var_dump(mb_check_encoding("\x00\xA1", "EUC-JP"));
//(2)
var_dump(mb_check_encoding("\x00\x81", "Shift_JIS"));
//(3)
var_dump(mb_check_encoding("\x00\xE3", "UTF-8"));
Expected result:
----------------
//(1)
bool(false)
//(2)
bool(false)
//(3)
bool(false)
Actual result:
--------------
//(1)
bool(true)
//(2)
bool(true)
//(3)
bool(true)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41147&edit=1