#41147 [Asn->Ana]: mb_check_encoding fails to check invalid string
| From: | hirokawa@php.net | Date: | Tue, 04 Sep 2007 14:30:07 +0000 |
| Subject: | #41147 [Asn->Ana]: mb_check_encoding fails to check invalid string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117107@lists.php.net to get a copy of this message | ||
ID: 41147
Updated by: hirokawa@php.net
Reported By: teracci2002 at yahoo dot co dot jp
-Status: Assigned
+Status: Analyzed
Bug Type: mbstring related
Operating System: Linux
PHP Version: 5.2.1
Assigned To: hirokawa
New Comment:
> 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
Previous Comments:
------------------------------------------------------------------------
[2007-08-19 20:10:06] jani@php.net
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] hirokawa@php.net
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] tony2001@php.net
Please explain why do you think it should succeed if the data is
invalid.
------------------------------------------------------------------------
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