mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-08 22:08:47 +08:00
add entis gls csx v1 disasm (ported from Crsky/EntisGLS_Tools)
This commit is contained in:
@@ -154,6 +154,16 @@ pub fn decode_to_string(
|
||||
},
|
||||
)
|
||||
.map_err(|_| anyhow::anyhow!("Failed to decode UTF-16LE"))?),
|
||||
Encoding::Utf16BE => Ok(encoding::codec::utf_16::UTF_16BE_ENCODING
|
||||
.decode(
|
||||
data,
|
||||
if check {
|
||||
DecoderTrap::Strict
|
||||
} else {
|
||||
DecoderTrap::Replace
|
||||
},
|
||||
)
|
||||
.map_err(|_| anyhow::anyhow!("Failed to decode UTF-16BE"))?),
|
||||
#[cfg(windows)]
|
||||
Encoding::CodePage(code_page) => Ok(super::encoding_win::decode_to_string(
|
||||
code_page, data, check,
|
||||
@@ -260,6 +270,10 @@ pub fn encode_string(
|
||||
let re = utf16string::WString::<utf16string::LE>::from(data);
|
||||
Ok(re.as_bytes().to_vec())
|
||||
}
|
||||
Encoding::Utf16BE => {
|
||||
let re = utf16string::WString::<utf16string::BE>::from(data);
|
||||
Ok(re.as_bytes().to_vec())
|
||||
}
|
||||
#[cfg(windows)]
|
||||
Encoding::CodePage(code_page) => {
|
||||
Ok(super::encoding_win::encode_string(code_page, data, check)?)
|
||||
|
||||
Reference in New Issue
Block a user