mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-09 14:28:53 +08:00
Add support to support PUA in BGI string
This commit is contained in:
@@ -251,7 +251,7 @@ impl<'a, T: Iterator<Item = &'a BinEntry>, R: Read + Seek> Iterator
|
||||
Ok(name) => name,
|
||||
Err(e) => return Some(Err(e.into())),
|
||||
};
|
||||
let name = match decode_to_string(self.archive_encoding, name.as_bytes()) {
|
||||
let name = match decode_to_string(self.archive_encoding, name.as_bytes(), true) {
|
||||
Ok(name) => name,
|
||||
Err(e) => return Some(Err(e.into())),
|
||||
};
|
||||
@@ -283,7 +283,7 @@ impl<'a, T: Iterator<Item = &'a BinEntry>, R: Read + Seek> Iterator
|
||||
Ok(name) => name,
|
||||
Err(e) => return Some(Err(e.into())),
|
||||
};
|
||||
let name = match decode_to_string(self.archive_encoding, name.as_bytes()) {
|
||||
let name = match decode_to_string(self.archive_encoding, name.as_bytes(), true) {
|
||||
Ok(name) => name,
|
||||
Err(e) => return Some(Err(e.into())),
|
||||
};
|
||||
|
||||
@@ -278,7 +278,7 @@ fn create_file<'a>(
|
||||
output_encoding: Encoding,
|
||||
) -> Result<()> {
|
||||
let input = crate::utils::files::read_file(custom_filename)?;
|
||||
let s = decode_to_string(output_encoding, &input)?;
|
||||
let s = decode_to_string(output_encoding, &input, true)?;
|
||||
let entries: Vec<ListEntry> = serde_json::from_str(&s)
|
||||
.map_err(|e| anyhow::anyhow!("Failed to read Escude list from JSON: {}", e))?;
|
||||
writer.write_all(b"LIST")?;
|
||||
|
||||
@@ -109,12 +109,12 @@ impl EscudeBinScript {
|
||||
for _ in 0..string_count {
|
||||
let s = reader.read_cstring()?;
|
||||
let s = replaces.replace(s.as_bytes())?;
|
||||
strings.push(decode_to_string(encoding, &s)?);
|
||||
strings.push(decode_to_string(encoding, &s, true)?);
|
||||
}
|
||||
} else {
|
||||
for _ in 0..string_count {
|
||||
let s = reader.read_cstring()?;
|
||||
strings.push(decode_to_string(encoding, s.as_bytes())?);
|
||||
strings.push(decode_to_string(encoding, s.as_bytes(), true)?);
|
||||
}
|
||||
}
|
||||
let names = match &config.escude_enum_scr {
|
||||
|
||||
Reference in New Issue
Block a user