From: Bruno Haible Date: Wed, 26 Sep 2001 18:11:01 +0000 (+0000) Subject: Tweak, needed for handling of PO files in SHIFT_JIS encoding. X-Git-Tag: v0.11~455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e85728f8f7e893f28d96ebf9ebd2ac50cd7b796b;p=thirdparty%2Fgettext.git Tweak, needed for handling of PO files in SHIFT_JIS encoding. --- diff --git a/src/ChangeLog b/src/ChangeLog index 828391d61..39bd81f20 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-09-24 Bruno Haible + + * 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 * msgunfmt.h: New file. diff --git a/src/po-lex.c b/src/po-lex.c index 34127a41e..ba5f27237 100644 --- a/src/po-lex.c +++ b/src/po-lex.c @@ -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);