From 4eaf45c06ebef6aee4aa7882041645599025a5c7 Mon Sep 17 00:00:00 2001 From: pudlisz Date: Mon, 28 Oct 2024 14:13:55 +0100 Subject: [PATCH] fix encoding for polish strings --- src-tauri/src/helpers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src-tauri/src/helpers.rs b/src-tauri/src/helpers.rs index e3ec72f7..a52c8a8e 100644 --- a/src-tauri/src/helpers.rs +++ b/src-tauri/src/helpers.rs @@ -46,6 +46,11 @@ pub fn decode_buffer(buf: Vec) -> (String, String) { { // Use windows-1251 for various combinations Encoding::for_label("windows-1251".as_bytes()).unwrap_or(UTF_8) + } else if chardetng_encoding == "windows-1250" + && (chardet_encoding == "iso-8859-1" || charset_normalizer_encoding == "windows-1251") + { + // Use windows-1250 for various combinations + Encoding::for_label("windows-1250".as_bytes()).unwrap_or(UTF_8) } else if (chardetng_encoding == "windows-1252" && chardet_encoding == "windows-1251") || (chardet_encoding == "iso-8859-1" && (charset_normalizer_encoding == "iso-8859-2"