summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-12-08 18:28:51 +0900
committerDaiki Ueno <ueno@gnu.org>2015-12-08 18:28:51 +0900
commitc15df930c6b0ad416c19963206e6158816e88e17 (patch)
treed902eed494b9f2be474a2def65958239c2ea19f6
parent77637e39456d902adcb9a67729edbe96204a6e90 (diff)
downloadexternal_gettext-c15df930c6b0ad416c19963206e6158816e88e17.zip
external_gettext-c15df930c6b0ad416c19963206e6158816e88e17.tar.gz
external_gettext-c15df930c6b0ad416c19963206e6158816e88e17.tar.bz2
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.
-rw-r--r--gettext-tools/src/xgettext.c8
1 files 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