]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make the msgcat-4 test work.
authorBruno Haible <bruno@clisp.org>
Thu, 1 Nov 2001 11:09:10 +0000 (11:09 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 20:47:55 +0000 (22:47 +0200)
src/ChangeLog
src/msgl-cat.c
src/msgl-iconv.c
src/msgl-iconv.h
src/write-java.c

index 3ba32e8a31aa4f1c616af81ec252fe4c384f80a0..a561b03d9995c5c7c00edfcb57d9e1798de8b0d3 100644 (file)
@@ -1,3 +1,13 @@
+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.
index 7d8f950fa6b84dd3e84a508538953898c5fd64fc..d90f5689dffbef7a5d75e6ede248a0f33d861245 100644 (file)
@@ -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.  */
index 3538cc7861316eeb6716f255b60e09c64a9fd117..c2967b5971f3e805c8c4f8a41d0d527a6b5f1b90 100644 (file)
@@ -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;
 }
index 7748f3d6581c9a1f877b09c59e3699e847b58ef3..66e9a15d9085deeb030de3636e1af0cde71d26c7 100644 (file)
 
 #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));
index 57a33ad63a7a0b30c24a166bd0a22e2c171868b9..e19763c8ff877548a166067abfc47194adc4da1a 100644 (file)
@@ -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;