]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Warn user if invalid encoding name is specified
authorDaiki Ueno <ueno@gnu.org>
Fri, 4 Apr 2014 09:23:24 +0000 (18:23 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 4 Apr 2014 09:23:24 +0000 (18:23 +0900)
gettext-tools/src/ChangeLog
gettext-tools/src/xgettext.c

index dc812ef0766eb90b519118189c48a77f9dca629b..1d850b0dc8f386851d23b1c8a97e818e9be8b204 100644 (file)
@@ -1,3 +1,10 @@
+2014-04-04  Daiki Ueno  <ueno@gnu.org>
+
+       * xgettext.c (main): Warn user if invalid encoding name is
+       specified with the --from-code option.
+       Reported by jaroslav.fojtik@evolvsys.cz in
+       <https://lists.gnu.org/archive/html/bug-gettext/2014-03/msg00034.html>.
+
 2014-04-04  Daiki Ueno  <ueno@gnu.org>
 
        msgfmt: Add support for Desktop Entry files
index 0598cfa74dc4e64545feef76b8be3aeb48c62f10..0c3e95632e824f1255bc130f2c4eb8388f3e6458 100644 (file)
@@ -538,7 +538,13 @@ main (int argc, char *argv[])
       case CHAR_MAX + 3:        /* --from-code */
         xgettext_global_source_encoding = po_charset_canonicalize (optarg);
         if (xgettext_global_source_encoding == NULL)
-          xgettext_global_source_encoding = po_charset_ascii;
+          {
+            multiline_warning (xasprintf (_("warning: ")),
+                               xasprintf (_("\
+'%s' is not a valid encoding name.  Using ASCII as fallback.\n"),
+                                          optarg));
+            xgettext_global_source_encoding = po_charset_ascii;
+          }
         break;
 
       case CHAR_MAX + 4:        /* --no-wrap */