netsurf: pass encoding to the parser

This commit is contained in:
Pierre Tachoire
2024-01-12 11:58:49 +01:00
parent 1a03412635
commit 028cd2331f
5 changed files with 9 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ fn testExecFn(
const file = try std.fs.cwd().openFile("test.html", .{});
defer file.close();
doc = try parser.documentHTMLParse(file.reader());
doc = try parser.documentHTMLParse(file.reader(), "UTF-8");
defer parser.documentHTMLClose(doc) catch |err| {
std.debug.print("documentHTMLClose error: {s}\n", .{@errorName(err)});
};
@@ -119,6 +119,6 @@ test "bug document html parsing #4" {
const file = try std.fs.cwd().openFile("tests/html/bug-html-parsing-4.html", .{});
defer file.close();
doc = try parser.documentHTMLParse(file.reader());
doc = try parser.documentHTMLParse(file.reader(), null);
parser.documentHTMLClose(doc) catch {};
}