(detect_coding_sjis): Check the byte sequence more regidly.
This commit is contained in:
parent
fc53a2147a
commit
fd6f711b51
2 changed files with 13 additions and 3 deletions
11
src/coding.c
11
src/coding.c
|
@ -2266,10 +2266,15 @@ detect_coding_sjis (src, src_end)
|
|||
while (1)
|
||||
{
|
||||
ONE_MORE_BYTE (c);
|
||||
if ((c >= 0x80 && c < 0xA0) || c >= 0xE0)
|
||||
if (c >= 0x81)
|
||||
{
|
||||
ONE_MORE_BYTE (c);
|
||||
if (c < 0x40)
|
||||
if (c <= 0x9F || (c >= 0xE0 && c <= 0xEF))
|
||||
{
|
||||
ONE_MORE_BYTE (c);
|
||||
if (c < 0x40 || c == 0x7F || c > 0xFC)
|
||||
return 0;
|
||||
}
|
||||
else if (c > 0xDF)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue