Add support to support PUA in BGI string

This commit is contained in:
2025-07-08 10:20:21 +08:00
parent e317c487fb
commit 601abba284
17 changed files with 104 additions and 60 deletions

View File

@@ -198,12 +198,12 @@ impl Script for CircusMesScript {
for t in text.iter_mut() {
*t = (*t).overflowing_add(self.info.deckey).0;
}
t = Some(decode_to_string(self.encoding, &text)?);
t = Some(decode_to_string(self.encoding, &text, true)?);
// println!("Token(enc): {:?}, {}", token, t.as_ref().unwrap());
} else if token.value == self.info.optunenc {
let text = &self.data[self.asm_bin_offset + token.offset + 1
..self.asm_bin_offset + token.offset + token.length - 1];
t = Some(decode_to_string(self.encoding, text)?);
t = Some(decode_to_string(self.encoding, text, true)?);
// println!("Token: {:?}, {}", token, t.as_ref().unwrap());
}
match t {
@@ -236,7 +236,7 @@ impl Script for CircusMesScript {
encoding: Encoding,
) -> Result<()> {
let jis = encode_string(Encoding::Cp932, s, true)?;
let out = decode_to_string(encoding, &jis)?;
let out = decode_to_string(encoding, &jis, true)?;
repls.push((s.to_string(), out));
Ok(())
}