From d7c1cc0276cc27a15ea8ce8dbbf93f8f185e3467 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Thu, 14 Sep 2023 19:03:38 +1200 Subject: [PATCH] LibWeb: Fix missing 'get an output encoding' step in HTMLFormElement This could mean that the picked encoding was not being set to UTF-8 if the documents encoding was 'replacement', 'utf-16le' or 'utf-16be'. --- Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 94dc1c13f3..a2a476c8bb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -545,7 +545,7 @@ ErrorOr HTMLFormElement::pick_an_encoding() const } // 3. Return the result of getting an output encoding from encoding. - return String::from_utf8(encoding.view()); + return MUST(String::from_utf8(TextCodec::get_output_encoding(encoding))); } // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#convert-to-a-list-of-name-value-pairs