Add new script Kirikiri TJS NS0 binary encoded script

This commit is contained in:
2025-08-31 00:06:02 +08:00
parent cef3064763
commit 94b489f412
11 changed files with 220 additions and 14 deletions

View File

@@ -15,6 +15,8 @@ pub enum Encoding {
Cp932,
/// GB2312 encoding
Gb2312,
/// UTF-16 Little Endian encoding
Utf16LE,
/// Code page encoding (Windows only)
#[cfg(windows)]
CodePage(u32),
@@ -37,6 +39,16 @@ impl Encoding {
}
}
/// Returns true if the encoding is UTF-16LE.
pub fn is_utf16le(&self) -> bool {
match self {
Self::Utf16LE => true,
#[cfg(windows)]
Self::CodePage(code_page) => *code_page == 1200,
_ => false,
}
}
/// Returns true if the encoding is UTF8.
pub fn is_utf8(&self) -> bool {
match self {
@@ -505,6 +517,10 @@ pub enum ScriptType {
#[value(alias("kr-mdf"))]
/// Kirikiri MDF (zlib compressed) file
KirikiriMdf,
#[cfg(feature = "kirikiri")]
#[value(alias("kr-tjs-ns0"))]
/// Kirikiri TJS NS0 binary encoded script
KirikiriTjsNs0,
#[cfg(feature = "softpal")]
/// Softpal src script
Softpal,