Mercurial > emacs
comparison src/coding.c @ 31458:ec8a58b2ec83
(detect_coding_sjis): Check the byte sequence more regidly.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Thu, 07 Sep 2000 12:58:15 +0000 |
| parents | b1c66af9aba5 |
| children | 57fa108c491f |
comparison
equal
deleted
inserted
replaced
| 31457:b1c66af9aba5 | 31458:ec8a58b2ec83 |
|---|---|
| 2264 struct coding_system *coding = &dummy_coding; | 2264 struct coding_system *coding = &dummy_coding; |
| 2265 | 2265 |
| 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 } |
| 2276 label_end_of_loop: | 2281 label_end_of_loop: |
| 2277 return CODING_CATEGORY_MASK_SJIS; | 2282 return CODING_CATEGORY_MASK_SJIS; |
