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

@@ -374,9 +374,11 @@ 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| {
module_prop_map.insert(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);
});
// Add enabled, update, remove flags
let enabled = !path.join(defs::DISABLE_FILE_NAME).exists();