diff options
| author | Kenichi Handa | 2000-09-07 13:01:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-09-07 13:01:44 +0000 |
| commit | fd6f711b51c82dc0d72c9288af5e3f5bab841979 (patch) | |
| tree | fc47ede5196554cc08d52260f16536ea22b5fac6 /src | |
| parent | fc53a2147a655cb0bef79fcdd76e4df6414c8ded (diff) | |
| download | emacs-fd6f711b51c82dc0d72c9288af5e3f5bab841979.tar.gz emacs-fd6f711b51c82dc0d72c9288af5e3f5bab841979.zip | |
(detect_coding_sjis): Check the byte sequence more regidly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/coding.c | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ba1be956858..73a27f79083 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,9 +1,14 @@ | |||
| 1 | 2000-09-07 Kenichi Handa <handa@etl.go.jp> | 1 | 2000-09-07 Kenichi Handa <handa@etl.go.jp> |
| 2 | 2 | ||
| 3 | * charset.h (MIN_CHARSET_OFFICIAL_DIMENSION1): Define it as 0x80, | ||
| 4 | not 0x81. | ||
| 5 | (MIN_CHAR_OFFICIAL_DIMENSION1): Define it as ((0x81 - 0x70) << 7). | ||
| 6 | |||
| 3 | * coding.c (encode_coding_sjis_big5): Use translation table for | 7 | * coding.c (encode_coding_sjis_big5): Use translation table for |
| 4 | encoding, not decoding. Fix the handling of latin-jisx0201. | 8 | encoding, not decoding. Fix the handling of latin-jisx0201. |
| 5 | Check for the charset katakana-jisx0201 too. | 9 | Check for the charset katakana-jisx0201 too. |
| 6 | (ONE_MORE_CHAR): Call translate_char with CHARSET arg -1. | 10 | (ONE_MORE_CHAR): Call translate_char with CHARSET arg -1. |
| 11 | (detect_coding_sjis): Check the byte sequence more regidly. | ||
| 7 | 12 | ||
| 8 | 2000-09-07 Gerd Moellmann <gerd@gnu.org> | 13 | 2000-09-07 Gerd Moellmann <gerd@gnu.org> |
| 9 | 14 | ||
diff --git a/src/coding.c b/src/coding.c index 366cf6647a7..fa079a749cb 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -2266,10 +2266,15 @@ detect_coding_sjis (src, src_end) | |||
| 2266 | while (1) | 2266 | while (1) |
| 2267 | { | 2267 | { |
| 2268 | ONE_MORE_BYTE (c); | 2268 | ONE_MORE_BYTE (c); |
| 2269 | if ((c >= 0x80 && c < 0xA0) || c >= 0xE0) | 2269 | if (c >= 0x81) |
| 2270 | { | 2270 | { |
| 2271 | ONE_MORE_BYTE (c); | 2271 | if (c <= 0x9F || (c >= 0xE0 && c <= 0xEF)) |
| 2272 | if (c < 0x40) | 2272 | { |
| 2273 | ONE_MORE_BYTE (c); | ||
| 2274 | if (c < 0x40 || c == 0x7F || c > 0xFC) | ||
| 2275 | return 0; | ||
| 2276 | } | ||
| 2277 | else if (c > 0xDF) | ||
| 2273 | return 0; | 2278 | return 0; |
| 2274 | } | 2279 | } |
| 2275 | } | 2280 | } |