.copied()
}
-pub fn encoding_from_hints(encoding: Option<&str>, codepage: Option<u32>) -> Option<&str> {
- if encoding.is_some() {
+use thiserror::Error as ThisError;
+#[derive(ThisError, Debug)]
+pub enum Error {
+ #[error("This system file does not indicate its own character encoding. Using default encoding {0}. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=\"DETECT\" to analyze the possible encodings.")]
+ NoEncoding(String),
+
+}
+
+/// Returns the character set used by the locale configured in the operating
+/// system. This should implement roughly the same behavior as the function
+/// with the same name in Gnulib. Until then, we'll just use a default.
+pub fn locale_charset() -> &'static str {
+ "UTF-8"
+}
+
+/*
+pub fn encoding_from_hints(encoding: Option<&str>, codepage: Option<u32>) -> Result<&str, ()> {
+ let label = if encoding.is_some() {
encoding
} else if let Some(codepage) = codepage {
match codepage {
}
} else {
None
- }
+ };
}
+*/