ID: 41147
Updated by: [EMAIL PROTECTED]
Reported By: teracci2002 at yahoo dot co dot jp
-Status: Open
+Status: Assigned
Bug Type: mbstring related
Operating System: Linux
PHP Version: 5.2.1
Assigned To: hirokawa
New Comment:
Someone disagrees, Rui.. :)
Previous Comments:
------------------------------------------------------------------------
[2007-08-18 16:00:06] teracci2002 at yahoo dot co dot jp
Just read bug report again.
No one says 0x00,0xa1 is invalid character in ShiftJIS.
------------------------------------------------------------------------
[2007-08-18 14:45:13] [EMAIL PROTECTED]
It is expected behavior because
0x00,0xa1 is null byte + valid ShiftJIS character.
mb_check_encoding should be used to detect invalid
or corrupted multibyte characters.
------------------------------------------------------------------------
[2007-04-20 10:11:03] teracci2002 at yahoo dot co dot jp
If the data is NOT valid, FALSE should be returned, I guess.
But actually it returns TRUE.
Am I wrong or missing your point?
------------------------------------------------------------------------
[2007-04-20 09:27:44] [EMAIL PROTECTED]
Please explain why do you think it should succeed if the data is
invalid.
------------------------------------------------------------------------
[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