+2001-11-01 Bruno Haible <haible@clisp.cons.org>
+
+ * 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 <haible@clisp.cons.org>
* msgl-equal.h (string_list_equal): New declaration.
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. */
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. */
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)
{
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;
}
#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));
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;