Add import support

This commit is contained in:
2025-05-20 22:43:45 +08:00
parent e2e7399832
commit 8aaf2da626
9 changed files with 278 additions and 50 deletions

View File

@@ -50,9 +50,7 @@ pub fn encode_string(encoding: Encoding, data: &str) -> Result<Vec<u8>, anyhow::
}
}
#[cfg(windows)]
Encoding::CodePage(code_page) => {
Ok(super::encoding_win::encode_string(code_page, data)?)
}
Encoding::CodePage(code_page) => Ok(super::encoding_win::encode_string(code_page, data)?),
}
}

View File

@@ -1,5 +1,7 @@
use windows_sys::Win32::Foundation::GetLastError;
use windows_sys::Win32::Globalization::{MB_ERR_INVALID_CHARS, MultiByteToWideChar, WideCharToMultiByte};
use windows_sys::Win32::Globalization::{
MB_ERR_INVALID_CHARS, MultiByteToWideChar, WideCharToMultiByte,
};
#[derive(Debug)]
pub struct WinError {

View File

@@ -1,7 +1,7 @@
use std::fs;
use std::io;
use std::path::Path;
use std::io::{Read, Write};
use std::path::Path;
use crate::scripts::ALL_EXTS;