mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for()
This commit is contained in:
committed by
Andreas Kling
parent
2f4c463920
commit
f2a9426885
@@ -514,7 +514,7 @@ void HTMLScriptElement::resource_did_load()
|
||||
// If the resource has an explicit encoding (i.e from a HTTP Content-Type header)
|
||||
// we have to re-encode it to UTF-8.
|
||||
if (resource()->has_encoding()) {
|
||||
if (auto* codec = TextCodec::decoder_for(resource()->encoding().value())) {
|
||||
if (auto codec = TextCodec::decoder_for(resource()->encoding().value()); codec.has_value()) {
|
||||
data = codec->to_utf8(data).to_byte_buffer();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user