summaryrefslogtreecommitdiff
path: root/fitz/base_xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/base_xml.c')
-rw-r--r--fitz/base_xml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fitz/base_xml.c b/fitz/base_xml.c
index d9ae68c1..c8635f93 100644
--- a/fitz/base_xml.c
+++ b/fitz/base_xml.c
@@ -428,6 +428,10 @@ fz_parse_xml(fz_context *ctx, unsigned char *s, int n)
parser.head = &root;
parser.ctx = ctx;
+ /* skip BOM in UTF-8 text */
+ if (s[0] == 0xEF && s[1] == 0xBB && s[2] == 0xBF)
+ s += 3;
+
p = convert_to_utf8(ctx, s, n);
error = xml_parse_document_imp(&parser, p);