mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-08 13:58:50 +08:00
Change utf-8 encoding behavior
This commit is contained in:
@@ -88,7 +88,8 @@ pub fn decode_to_string(
|
||||
Encoding::Auto => decode_to_string(Encoding::Utf8, data, check)
|
||||
.or_else(|_| decode_to_string(Encoding::Cp932, data, check))
|
||||
.or_else(|_| decode_to_string(Encoding::Gb2312, data, check)),
|
||||
Encoding::Utf8 => Ok(String::from_utf8(data.to_vec())?),
|
||||
// Keep same behavior as Windows API (Code Page 65001)
|
||||
Encoding::Utf8 => Ok(String::from_utf8_lossy(data).into_owned()),
|
||||
Encoding::Cp932 => {
|
||||
let result = encoding::codec::japanese::Windows31JEncoding
|
||||
.decode(
|
||||
|
||||
Reference in New Issue
Block a user