diff options
author | Bruno Haible <bruno@clisp.org> | 2003-05-21 10:56:24 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:10:36 +0200 |
commit | c323554562ffe00970b4f001fa7cc65afcf8daf4 (patch) | |
tree | 6fea61309e9de26385291f7adfc29d28d84d68ec /gettext-tools | |
parent | 0521f0b8435b9b06a97677b4dcf89ffedc45a7ef (diff) | |
download | external_gettext-c323554562ffe00970b4f001fa7cc65afcf8daf4.zip external_gettext-c323554562ffe00970b4f001fa7cc65afcf8daf4.tar.gz external_gettext-c323554562ffe00970b4f001fa7cc65afcf8daf4.tar.bz2 |
Avoid an error when --properties-output is specified and all msgids are ASCII.
Diffstat (limited to 'gettext-tools')
-rw-r--r-- | gettext-tools/src/ChangeLog | 6 | ||||
-rw-r--r-- | gettext-tools/src/xgettext.c | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 4ba9be5..252587e 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -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. diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index ae113e2..231819a 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -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; |