]> git.eshelyaron.com Git - emacs.git/commitdiff
(detect_coding_sjis): Check the byte sequence more regidly.
authorKenichi Handa <handa@m17n.org>
Thu, 7 Sep 2000 13:01:44 +0000 (13:01 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 7 Sep 2000 13:01:44 +0000 (13:01 +0000)
src/ChangeLog
src/coding.c

index ba1be956858631e09f01354f28718729364650b2..73a27f79083a265b4f199c2b700c7bb6dc7f3712 100644 (file)
@@ -1,9 +1,14 @@
 2000-09-07  Kenichi Handa  <handa@etl.go.jp>
 
+       * charset.h (MIN_CHARSET_OFFICIAL_DIMENSION1): Define it as 0x80,
+       not 0x81.
+       (MIN_CHAR_OFFICIAL_DIMENSION1): Define it as ((0x81 - 0x70) << 7).
+
        * coding.c (encode_coding_sjis_big5): Use translation table for
        encoding, not decoding.  Fix the handling of latin-jisx0201.
        Check for the charset katakana-jisx0201 too.
        (ONE_MORE_CHAR): Call translate_char with CHARSET arg -1.
+       (detect_coding_sjis): Check the byte sequence more regidly.
 
 2000-09-07  Gerd Moellmann  <gerd@gnu.org>
 
index 366cf6647a72a8b9bf41aa4c9e552a784ecac0ca..fa079a749cb04ac93af6d0d31a2f510b3846792b 100644 (file)
@@ -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;
        }
     }