From: Daiki Ueno Date: Fri, 4 Apr 2014 09:23:24 +0000 (+0900) Subject: xgettext: Warn user if invalid encoding name is specified X-Git-Tag: v0.19~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cdbe3cfeb83bf25c123dab7fcd17d01bbff972b;p=thirdparty%2Fgettext.git xgettext: Warn user if invalid encoding name is specified --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index dc812ef07..1d850b0dc 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2014-04-04 Daiki Ueno + + * xgettext.c (main): Warn user if invalid encoding name is + specified with the --from-code option. + Reported by jaroslav.fojtik@evolvsys.cz in + . + 2014-04-04 Daiki Ueno msgfmt: Add support for Desktop Entry files diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 0598cfa74..0c3e95632 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -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 */