]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid an error when --properties-output is specified and all msgids are ASCII.
authorBruno Haible <bruno@clisp.org>
Wed, 21 May 2003 10:56:24 +0000 (10:56 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:36 +0000 (12:10 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/xgettext.c

index 4ba9be5465e6a72d4c83e230bb2e7d1eda8d5c7a..252587e4976b883d0c2bf02004025f14716edb7d 100644 (file)
@@ -1,3 +1,9 @@
+2003-05-21  Bruno Haible  <bruno@clisp.org>
+
+       * xgettext.c (output_syntax): New variable.
+       (main): Set it.
+       (finalize_header): If --properties-output was given, set the charset.
+
 2003-05-18  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.msvc (DEBUGFLAGS): New variable.
index ae113e2f737b3ea8c662790bbb0f1bbba9569ac5..231819a1c7ffb86c7c6bef5a12e51a3cc65e4b61 100644 (file)
@@ -117,6 +117,9 @@ static const char *msgstr_suffix;
 /* Directory in which output files are created.  */
 static char *output_dir;
 
+/* The output syntax: .pot or .properties.  */
+static input_syntax_ty output_syntax = syntax_po;
+
 /* If nonzero omit header with information about this run.  */
 int xgettext_omit_header;
 
@@ -397,6 +400,7 @@ main (int argc, char *argv[])
        break;
       case CHAR_MAX + 6:       /* --properties-output */
        message_print_syntax_properties ();
+       output_syntax = syntax_properties;
        break;
       default:
        usage (EXIT_FAILURE);
@@ -1399,9 +1403,10 @@ finalize_header (msgdomain_list_ty *mdlp)
       }
   }
 
-  /* If not all the strings were plain ASCII, set the charset in the header
-     to UTF-8.  All messages have already been converted to UTF-8 in
-     remember_a_message and remember_a_message_plural.  */
+  /* If not all the strings were plain ASCII, or if the output syntax
+     requires a charset conversion, set the charset in the header to UTF-8.
+     All messages have already been converted to UTF-8 in remember_a_message
+     and remember_a_message_plural.  */
   {
     bool has_nonascii = false;
     size_t i;
@@ -1414,7 +1419,7 @@ finalize_header (msgdomain_list_ty *mdlp)
          has_nonascii = true;
       }
 
-    if (has_nonascii)
+    if (has_nonascii || output_syntax == syntax_properties)
       {
        message_list_ty *mlp = mdlp->item[0]->messages;