diff options
-rw-r--r-- | lib/ChangeLog | 6 | ||||
-rw-r--r-- | lib/linebreak.c | 18 | ||||
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/write-po.c | 6 |
4 files changed, 32 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index d592dae..a2ad0b7 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2001-05-23 Bruno Haible <haible@clisp.cons.org> + + * linebreak.c (mbs_possible_linebreaks): Avoid broken EUC-KR + conversion in glibc-2.1. + (mbs_width_linebreaks): Likewise. + 2001-05-15 Bruno Haible <haible@clisp.cons.org> * progname.h (set_program_name): New declaration. diff --git a/lib/linebreak.c b/lib/linebreak.c index 164f730..e3bacae 100644 --- a/lib/linebreak.c +++ b/lib/linebreak.c @@ -1711,7 +1711,14 @@ mbs_possible_linebreaks (s, n, encoding, p) else { #if HAVE_ICONV - iconv_t to_utf8 = iconv_open (UTF8_NAME, encoding); + iconv_t to_utf8; + /* Avoid glibc-2.1 bug with EUC-KR. */ +# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION + if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)) + to_utf8 = (iconv_t)(-1); + else +# endif + to_utf8 = iconv_open (UTF8_NAME, encoding); if (to_utf8 != (iconv_t)(-1)) { /* Determine the length of the resulting UTF-8 string. */ @@ -1790,7 +1797,14 @@ mbs_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) else { #if HAVE_ICONV - iconv_t to_utf8 = iconv_open (UTF8_NAME, encoding); + iconv_t to_utf8; + /* Avoid glibc-2.1 bug with EUC-KR. */ +# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION + if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)) + to_utf8 = (iconv_t)(-1); + else +# endif + to_utf8 = iconv_open (UTF8_NAME, encoding); if (to_utf8 != (iconv_t)(-1)) { /* Determine the length of the resulting UTF-8 string. */ diff --git a/src/ChangeLog b/src/ChangeLog index 06d521b..c047bda 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-05-23 Bruno Haible <haible@clisp.cons.org> + + * write-po.c (wrap): Avoid broken EUC-KR conversion in glibc-2.1. + 2001-05-21 Bruno Haible <haible@clisp.cons.org> * xgettext.c (construct_header): Replace 8-bit with 8bit. diff --git a/src/write-po.c b/src/write-po.c index 0f65809..1479b36 100644 --- a/src/write-po.c +++ b/src/write-po.c @@ -211,6 +211,12 @@ wrap (fp, line_prefix, name, value, do_wrap, charset) /* Write a PO file in old format, with extraneous backslashes. */ conv = (iconv_t)(-1); else + /* Avoid glibc-2.1 bug with EUC-KR. */ +# if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined _LIBICONV_VERSION + if (strcmp (charset, "EUC-KR") == 0) + conv = (iconv_t)(-1); + else +# endif /* Use iconv() to parse multibyte characters. */ conv = iconv_open ("UTF-8", charset); #endif |