ID: 41147 User updated by: teracci2002 at yahoo dot co dot jp Reported By: teracci2002 at yahoo dot co dot jp Status: Analyzed Bug Type: mbstring related Operating System: Linux PHP Version: 5.2.1 Assigned To: hirokawa New Comment:
> 0x00+0xa1 is valid byte sequence in Shift_JIS sequence. I know it. But 0x00+0x81 is invalid sequence in Shift_JIS. Then, why below statement returns "bool(true)" ? var_dump(mb_check_encoding("\x00\x81", "Shift_JIS")); Read bug report again, please. Previous Comments: ------------------------------------------------------------------------ [2007-09-04 14:30:06] [EMAIL PROTECTED] > No one says 0x00,0xa1 is invalid character in ShiftJIS. I didn't say that. 0x00+0xa1 is valid byte sequence in Shift_JIS sequence. A character in Shift_JIS encoding is encoded in either single byte or double byte. In this case, the byte stream is reconigzed as two character, a null byte and a comma character in Katakana(0xa1) see: http://hp.vector.co.jp/authors/VA013241/misc/shiftjis.html ------------------------------------------------------------------------ [2007-08-19 20:10:06] [EMAIL PROTECTED] Someone disagrees, Rui.. :) ------------------------------------------------------------------------ [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? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/41147 -- Edit this bug report at http://bugs.php.net/?id=41147&edit=1