]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Tweak, needed for handling of PO files in SHIFT_JIS encoding.
authorBruno Haible <bruno@clisp.org>
Wed, 26 Sep 2001 18:11:01 +0000 (18:11 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 26 Sep 2001 18:11:01 +0000 (18:11 +0000)
src/ChangeLog
src/po-lex.c

index 828391d61bf036afbb749cc2701a0e082e2b4acc..39bd81f204b73ef893d5149864b731e6a6616097 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-24  Bruno Haible  <haible@clisp.cons.org>
+
+       * po-lex.c (mb_iseq): Compare the byte sequence, not the Unicode
+       equivalent. This is necessary for non-ASCII-compatible encodings like
+       SHIFT_JIS.
+
 2001-09-08  Bruno Haible  <haible@clisp.cons.org>
 
        * msgunfmt.h: New file.
index 34127a41e11316b0fc53015c219987f6d2fa7994..ba5f27237a0ef4de1c286537011289d3f39469a7 100644 (file)
@@ -267,9 +267,13 @@ mb_iseq (mbc, sc)
      const mbchar_t mbc;
      char sc;
 {
-#if HAVE_ICONV
+  /* Note: It is wrong to compare only mbc->uc, because when the encoding is
+     SHIFT_JIS, mbc->buf[0] == '\\' corresponds to mbc->uc == 0x00A5, but we
+     want to treat it as an escape character, although it looks like a Yen
+     sign.  */
+#if HAVE_ICONV && 0
   if (mbc->uc_valid)
-    return (mbc->uc == sc);
+    return (mbc->uc == sc); /* wrong! */
   else
 #endif
     return (mbc->bytes == 1 && mbc->buf[0] == sc);