From: Daiki Ueno Date: Tue, 8 Dec 2015 09:28:51 +0000 (+0900) Subject: xgettext: Ignore --from-code when XML mode X-Git-Tag: v0.19.7~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c15df930c6b0ad416c19963206e6158816e88e17;p=thirdparty%2Fgettext.git xgettext: Ignore --from-code when XML mode * gettext-tools/src/xgettext.c (extract_from_xml_file): Forcibly set current source encoding to UTF-8, on XML mode. --- diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index bb63a2690..871a6f4f5 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -2271,9 +2271,11 @@ extract_from_xml_file (const char *file_name, char *real_file_name; FILE *fp = xgettext_open (file_name, &logical_file_name, &real_file_name); - /* Set the default for the source file encoding. May be overridden by - the extractor function. */ - xgettext_current_source_encoding = xgettext_global_source_encoding; + /* The default encoding for XML is UTF-8. It can be overridden by + an XML declaration in the XML file itself, not through the + --from-code option. */ + xgettext_current_source_encoding = po_charset_utf8; + #if HAVE_ICONV xgettext_current_source_iconv = xgettext_global_source_iconv; #endif