mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-20 02:44:29 +08:00
Add support to support PUA in BGI string
This commit is contained in:
@@ -164,7 +164,7 @@ impl Dref {
|
||||
filename: &str,
|
||||
_config: &ExtraConfig,
|
||||
) -> Result<Self> {
|
||||
let text = decode_with_bom_detect(encoding, &buf)?.0;
|
||||
let text = decode_with_bom_detect(encoding, &buf, true)?.0;
|
||||
let mut urls = Vec::new();
|
||||
for text in text.lines() {
|
||||
let text = text.trim();
|
||||
|
||||
@@ -666,7 +666,7 @@ pub struct KsScript {
|
||||
|
||||
impl KsScript {
|
||||
pub fn new(reader: Vec<u8>, encoding: Encoding, config: &ExtraConfig) -> Result<Self> {
|
||||
let (text, bom) = decode_with_bom_detect(encoding, &reader)?;
|
||||
let (text, bom) = decode_with_bom_detect(encoding, &reader, true)?;
|
||||
let parser = Parser::new(&text);
|
||||
let tree = parser.parse(!config.kirikiri_remove_empty_lines)?;
|
||||
Ok(Self {
|
||||
|
||||
@@ -618,7 +618,7 @@ impl Script for ScnScript {
|
||||
output_encoding: Encoding,
|
||||
) -> Result<()> {
|
||||
let data = crate::utils::files::read_file(custom_filename)?;
|
||||
let s = decode_to_string(output_encoding, &data)?;
|
||||
let s = decode_to_string(output_encoding, &data, true)?;
|
||||
let json = json::parse(&s)?;
|
||||
let mut psb = self.psb.clone();
|
||||
psb.from_json(&json)?;
|
||||
|
||||
Reference in New Issue
Block a user