1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:57:34 +00:00

LibWeb: Plumb content encoding into the new HTML parser

We still don't handle non-ASCII input correctly, but at least now we'll
convert e.g ISO-8859-1 to UTF-8 before starting to tokenize.
This patch also makes "view source" work with the new parser. :^)
This commit is contained in:
Andreas Kling 2020-05-28 12:35:19 +02:00
parent 772b51038e
commit 5e53c45113
6 changed files with 18 additions and 9 deletions

View file

@ -47,7 +47,7 @@ int main(int argc, char** argv)
return 1;
auto contents = file_or_error.value()->read_all();
Web::HTMLDocumentParser parser(contents);
Web::HTMLDocumentParser parser(contents, "utf-8");
parser.run(URL::create_with_file_protocol(input_path));
auto& document = parser.document();