]> git.eshelyaron.com Git - emacs.git/commitdiff
(DECODE_ISO_CHARACTER): While decoding two-byte code,
authorKenichi Handa <handa@m17n.org>
Thu, 9 Jul 1998 02:02:33 +0000 (02:02 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 9 Jul 1998 02:02:33 +0000 (02:02 +0000)
if the sencond byte is invalid, produce the first byte as is.

src/coding.c

index 6c537df830c3ab53ddd0466c8074b53cb1b7fa92..81fda21f1cb6d8b718b91e2e39da36f0762767e4 100644 (file)
@@ -884,21 +884,21 @@ detect_coding_iso2022 (src, src_end)
          *dst++ = 0xFF;                                                \
        coding->composing += 2;                                         \
       }                                                                        \
-    if ((charset) >= 0)                                                        \
+    if (charset_alt >= 0)                                              \
       {                                                                        \
-       if (CHARSET_DIMENSION (charset) == 2)                           \
+       if (CHARSET_DIMENSION (charset_alt) == 2)                       \
          {                                                             \
            ONE_MORE_BYTE (c2);                                         \
            if (iso_code_class[(c2) & 0x7F] != ISO_0x20_or_0x7F         \
                && iso_code_class[(c2) & 0x7F] != ISO_graphic_plane_0)  \
              {                                                         \
                src--;                                                  \
-               c2 = ' ';                                               \
+               charset_alt = CHARSET_ASCII;                            \
              }                                                         \
          }                                                             \
        if (!NILP (translation_table)                                   \
            && ((c_alt = translate_char (translation_table,             \
-                                        -1, (charset), c1, c2)) >= 0)) \
+                                        -1, charset_alt, c1, c2)) >= 0)) \
          SPLIT_CHAR (c_alt, charset_alt, c1, c2);                      \
       }                                                                        \
     if (charset_alt == CHARSET_ASCII || charset_alt < 0)               \