From: Bruno Haible Date: Thu, 1 Nov 2001 11:09:10 +0000 (+0000) Subject: Make the msgcat-4 test work. X-Git-Tag: v0.11~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f75cd75a4552cbae16571ebb534ef9ccd5d83f3;p=thirdparty%2Fgettext.git Make the msgcat-4 test work. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3ba32e8a3..a561b03d9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2001-11-01 Bruno Haible + + * msgl-iconv.h (iconv_message_list): Add argument 'canon_from_code'. + * msgl-iconv.c (iconv_message_list): Add argument 'canon_from_code'. + (iconv_msgdomain_list): Update. + * write-java.c (msgdomain_write_java): Update. + * msgl-cat.c (catenate_msgdomain_list): Pass the canon_charsets[n][k] + to iconv_message_list; the header entry that contained the charset + specification may already have been removed from the message list. + 2001-11-01 Bruno Haible * msgl-equal.h (string_list_equal): New declaration. diff --git a/src/msgl-cat.c b/src/msgl-cat.c index 7d8f950fa..d90f5689d 100644 --- a/src/msgl-cat.c +++ b/src/msgl-cat.c @@ -445,7 +445,8 @@ To select a different output encoding, use the --to-code option.\n\ conversion that would only replace the charset name in the header entry with its canonical equivalent. */ if (!(to_code == NULL && canon_charsets[n][k] == canon_to_code)) - iconv_message_list (mdlp->item[k]->messages, canon_to_code); + iconv_message_list (mdlp->item[k]->messages, canon_charsets[n][k], + canon_to_code); } /* Fill the resulting messages. */ diff --git a/src/msgl-iconv.c b/src/msgl-iconv.c index 3538cc786..c2967b597 100644 --- a/src/msgl-iconv.c +++ b/src/msgl-iconv.c @@ -258,11 +258,11 @@ convert_msgstr (cd, mp) void -iconv_message_list (mlp, canon_to_code) +iconv_message_list (mlp, canon_from_code, canon_to_code) message_list_ty *mlp; + const char *canon_from_code; const char *canon_to_code; { - const char *canon_from_code; size_t j; /* If the list is empty, nothing to do. */ @@ -270,7 +270,6 @@ iconv_message_list (mlp, canon_to_code) return; /* Search the header entry, and extract and replace the charset name. */ - canon_from_code = NULL; for (j = 0; j < mlp->nitems; j++) if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete) { @@ -384,7 +383,7 @@ iconv_msgdomain_list (mdlp, to_code) to_code); for (k = 0; k < mdlp->nitems; k++) - iconv_message_list (mdlp->item[k]->messages, canon_to_code); + iconv_message_list (mdlp->item[k]->messages, NULL, canon_to_code); return mdlp; } diff --git a/src/msgl-iconv.h b/src/msgl-iconv.h index 7748f3d65..66e9a15d9 100644 --- a/src/msgl-iconv.h +++ b/src/msgl-iconv.h @@ -21,9 +21,16 @@ #include "message.h" +/* Converts the message list MLP to the (already canonicalized) encoding + CANON_TO_CODE. The (already canonicalized) encoding before conversion + can be passed as CANON_FROM_CODE; if NULL is passed instead, the + encoding is looked up in the header entry. */ extern void iconv_message_list PARAMS ((message_list_ty *mlp, + const char *canon_from_code, const char *canon_to_code)); + +/* Converts all the message lists in MDLP to the encoding TO_CODE. */ extern msgdomain_list_ty * iconv_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp, const char *to_code)); diff --git a/src/write-java.c b/src/write-java.c index 57a33ad63..e19763c8f 100644 --- a/src/write-java.c +++ b/src/write-java.c @@ -1093,7 +1093,7 @@ msgdomain_write_java (mlp, resource_name, locale_name, directory, assume_java2) retval = 1; /* Convert the messages to Unicode. */ - iconv_message_list (mlp, po_charset_canonicalize ("UTF-8")); + iconv_message_list (mlp, NULL, po_charset_canonicalize ("UTF-8")); cleanup_list.tmpdir = NULL; cleanup_list.subdir_count = 0;