From eeaea0df167b28070a9c59e5a08525103f5be7bd Mon Sep 17 00:00:00 2001 From: Sunshine Date: Fri, 2 Jul 2021 21:34:08 -1000 Subject: [PATCH] fix use of wrong charset --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7798759..d3b88b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -219,11 +219,8 @@ fn main() { if !html_charset.is_empty() { // Check if the charset specified inside HTML is valid if let Some(encoding) = Encoding::for_label_no_replacement(html_charset.as_bytes()) { - // No point in parsing HTML again with the same encoding as before - if encoding.name() != "UTF-8" { - document_encoding = html_charset; - dom = html_to_dom(&data, document_encoding.clone()); - } + document_encoding = html_charset; + dom = html_to_dom(&data, encoding.name().to_string()); } } }