ksud: fix encoding error

This commit is contained in:
tiann
2023-01-04 17:26:21 +08:00
parent d8f5d74ec3
commit 3280c6af2e
3 changed files with 7 additions and 3 deletions

View File

@@ -421,6 +421,7 @@ dependencies = [
"anyhow",
"clap",
"const_format",
"encoding",
"env_logger",
"java-properties",
"log",

View File

@@ -19,6 +19,7 @@ env_logger = "0.10.0"
serde = { version = "1.0" }
serde_json = "1.0"
regex = "1.5.4"
encoding = "0.2.33"
[profile.release]
strip = true

View File

@@ -374,7 +374,9 @@ fn do_list_modules(path: &str) -> Vec<HashMap<String, String>> {
continue;
};
let mut module_prop_map = HashMap::new();
let result = PropertiesIter::new(Cursor::new(content)).read_into(|k, v| {
let encoding = encoding::all::UTF_8;
let result =
PropertiesIter::new_with_encoding(Cursor::new(content), encoding).read_into(|k, v| {
module_prop_map.insert(k, v);
});