From c15df930c6b0ad416c19963206e6158816e88e17 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 8 Dec 2015 18:28:51 +0900 Subject: 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. --- gettext-tools/src/xgettext.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index bb63a26..871a6f4 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 -- cgit v1.1