use thiserror::Error as ThisError;
#[derive(ThisError, Debug)]
pub enum Error {
- #[error("This system file does not indicate its own character encoding. xFor best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=\"DETECT\" to analyze the possible encodings.")]
+ #[error("This system file does not indicate its own character encoding. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=\"DETECT\" to analyze the possible encodings.")]
NoEncoding,
#[error("This system file encodes text strings with unknown code page {0}.")]
- UnknownCodepage(u32),
+ UnknownCodepage(i32),
#[error("This system file is encoded in EBCDIC, which is not supported.")]
Ebcdic,
"UTF-8"
}
-pub fn get_encoding(encoding: Option<&str>, character_code: Option<u32>) -> Result<&str, Error> {
+pub fn get_encoding(encoding: Option<&str>, character_code: Option<i32>) -> Result<&str, Error> {
if let Some(encoding) = encoding {
Ok(encoding)
} else if let Some(codepage) = character_code {