From 58a25d33ce03c2b4944f0b187da29a635410e86b Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 16 Apr 2017 18:12:36 +0300 Subject: Attempt latin1 parsing on import We parse input XML using UTF-8 encoding by default. If this fails, try latin1 instead. Signed-off-by: Miika Turkia --- core/parse-xml.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') diff --git a/core/parse-xml.c b/core/parse-xml.c index c6b7b9ae6..d1cfc88ed 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -2042,6 +2042,9 @@ int parse_xml_buffer(const char *url, const char *buffer, int size, target_table = table; doc = xmlReadMemory(res, strlen(res), url, NULL, 0); + if (!doc) + doc = xmlReadMemory(res, strlen(res), url, "latin1", 0); + if (res != buffer) free((char *)res); -- cgit v1.2.3-70-g09d2