1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringView

We don't need a full String/DeprecatedString inside this function, so we
might as well not force users to create one.
This commit is contained in:
Sam Atkins 2023-02-13 17:23:31 +00:00 committed by Tim Flynn
parent 3c8bfa4662
commit d6075ef5b5
14 changed files with 16 additions and 16 deletions

View file

@ -877,7 +877,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (Utf8View { file_contents }.validate()) {
builder.append(source);
} else {
auto* decoder = TextCodec::decoder_for("windows-1252");
auto* decoder = TextCodec::decoder_for("windows-1252"sv);
VERIFY(decoder);
auto utf8_source = TextCodec::convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(*decoder, source);