summaryrefslogtreecommitdiff
path: root/liblangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-08-11 12:50:11 +0200
committerEike Rathke <erack@redhat.com>2012-08-11 13:41:26 +0200
commit15e7f34a2134b1a4d892f4e4d945b9cb547202ac (patch)
tree7800f0d57775ec050961b62b10a046b7613d39d7 /liblangtag
parent4af24fb1a3dd359be4b97f7682678aa5b8d2ff1a (diff)
langtag: worked around reg2xml libxml2 encoding problem
libxml2 has a problem when a document encoding is specified, even though documentation says that all internal representation would be in UTF-8 and language-subtag-registry data already is passed in UTF-8, when specifying the document encoding to be UTF-8 the output to language-subtag-registry.xml is conversion garbage, '?' on Linux UTF-8 locale, ISO-8859-1 on Windows. If no document encoding is specified at all no conversion happens and non-ASCII values are correctly written as entities.
Diffstat (limited to 'liblangtag')
-rw-r--r--liblangtag/liblangtag-0.2-reg2xml-encoding-problem.patch18
-rw-r--r--liblangtag/makefile.mk1
2 files changed, 19 insertions, 0 deletions
diff --git a/liblangtag/liblangtag-0.2-reg2xml-encoding-problem.patch b/liblangtag/liblangtag-0.2-reg2xml-encoding-problem.patch
new file mode 100644
index 000000000000..cae5df5b9917
--- /dev/null
+++ b/liblangtag/liblangtag-0.2-reg2xml-encoding-problem.patch
@@ -0,0 +1,18 @@
+# libxml2 has a problem when a document encoding is specified, even though
+# documentation says that all internal representation would be in UTF-8 and
+# language-subtag-registry data already is passed in UTF-8, when specifying the
+# document encoding to be UTF-8 the output to language-subtag-registry.xml is
+# conversion garbage, '?' on Linux UTF-8 locale, ISO-8859-1 on Windows. If no
+# document encoding is specified at all no conversion happens and non-ASCII
+# values are correctly written as entities.
+
+--- misc/liblangtag-0.2/data/reg2xml.c 2012-01-30 13:20:57.000000000 +0100
++++ misc/build/liblangtag-0.2/data/reg2xml.c 2012-08-11 02:30:39.147779753 +0200
+@@ -144,7 +144,6 @@
+ gboolean retval;
+
+ doc = xmlNewDoc((const xmlChar *)"1.0");
+- doc->encoding = xmlStrdup((const xmlChar *)"UTF-8");
+ root = xmlNewDocNode(doc, NULL,
+ (const xmlChar *)"registry",
+ NULL);
diff --git a/liblangtag/makefile.mk b/liblangtag/makefile.mk
index 6acd16067f32..f318f8e8166f 100644
--- a/liblangtag/makefile.mk
+++ b/liblangtag/makefile.mk
@@ -41,6 +41,7 @@ PATCH_FILES+=liblangtag-0.2-0002-Fix-invalid-memory-access.patch
PATCH_FILES+=liblangtag-0.2-configure.patch
PATCH_FILES+=liblangtag-0.2-datadir.patch
PATCH_FILES+=liblangtag-0.2-msvc-warning.patch
+PATCH_FILES+=liblangtag-0.2-reg2xml-encoding-problem.patch
CONFIGURE_DIR=.
BUILD_DIR=$(CONFIGURE_DIR)