0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-09-21 19:46:23 -04:00

[xml] Force "utf-8" encoding.

It is a step backwards. At least test cases for document.write don't crash.
This commit is contained in:
Witold Filipczyk
2022-11-20 20:24:29 +01:00
parent df28d4345b
commit c9fe1bf546
6 changed files with 21 additions and 16 deletions

View File

@@ -385,7 +385,7 @@ check_for_rerender(struct ecmascript_interpreter *interpreter, const char* text)
text += interpreter->writecode.source;
text += "</root>";
xmlDoc* doc = htmlReadDoc((xmlChar*)text.c_str(), NULL, NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING);
xmlDoc* doc = htmlReadDoc((xmlChar*)text.c_str(), NULL, "utf-8", HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING);
// Encapsulate raw libxml document in a libxml++ wrapper
xmlpp::Document doc1(doc);
@@ -889,7 +889,7 @@ document_parse(struct document *document)
add_bytes_to_string(&str, f->data, f->length);
// Parse HTML and create a DOM tree
xmlDoc* doc = htmlReadDoc((xmlChar*)str.source, NULL, NULL,
xmlDoc* doc = htmlReadDoc((xmlChar*)str.source, NULL, "utf-8",
HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING);
// Encapsulate raw libxml document in a libxml++ wrapper
xmlpp::Document *docu = new xmlpp::Document(doc);