]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Ignore --from-code when XML mode
authorDaiki Ueno <ueno@gnu.org>
Tue, 8 Dec 2015 09:28:51 +0000 (18:28 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 8 Dec 2015 09:28:51 +0000 (18:28 +0900)
* 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

index bb63a2690820f58d75a85d60313686bd558b1d8e..871a6f4f5039d046ab4212473f4a6a40da7e8b88 100644 (file)
@@ -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