work
[pspp] / rust / src / encoding.rs
index 3d585a6b635f94fa4f69284a96fcbeb085a778bf..3509b73954930fee0b64ba041fc1f65484949010 100644 (file)
@@ -9,11 +9,11 @@ pub fn codepage_from_encoding(encoding: &str) -> Option<u32> {
 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,
@@ -26,7 +26,7 @@ pub fn locale_charset() -> &'static str {
     "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 {