1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 20:45:08 +00:00

LibWeb: Handle iso-8859-1 web content a little bit better

We now look at the HTTP response headers for a Content-Type header and
try to parse it if present to find the text encoding.

If the text encoding is iso-8859-1, we turn all non-ASCII characters
into question marks. This makes Swedish Google load on my machine! :^)
This commit is contained in:
Andreas Kling 2020-05-03 22:22:05 +02:00
parent eb6e35a1be
commit f3676ebef5
3 changed files with 44 additions and 6 deletions

View file

@ -33,7 +33,7 @@ namespace Web {
class DocumentFragment;
RefPtr<Document> parse_html_document(const StringView&, const URL& = URL());
RefPtr<DocumentFragment> parse_html_fragment(Document&, const StringView&);
RefPtr<Document> parse_html_document(const StringView&, const URL& = URL(), const String& encoding = "utf-8");
RefPtr<DocumentFragment> parse_html_fragment(Document&, const StringView&, const String& encoding = "utf-8");
}