mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-29 04:26:55 -06:00
G2: improve editing reliability and Windows rendering fidelity
This commit is contained in:
@@ -167,7 +167,7 @@ impl P<'_> {
|
||||
}
|
||||
}
|
||||
if raw.starts_with(&[0xFE, 0xFF]) {
|
||||
let u: Vec<u16> = raw[2..].chunks_exact(2).map(|c| u16::from_be_bytes([c[0], c[1]])).collect();
|
||||
let u: Vec<u16> = raw[2..].as_chunks::<2>().0.iter().map(|c| u16::from_be_bytes([c[0], c[1]])).collect();
|
||||
String::from_utf16_lossy(&u).trim_end_matches('\0').to_string()
|
||||
} else {
|
||||
String::from_utf8_lossy(&raw).into_owned()
|
||||
|
||||
Reference in New Issue
Block a user