summaryrefslogtreecommitdiff
path: root/src/encoding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding.rs')
-rw-r--r--src/encoding.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/encoding.rs b/src/encoding.rs
index a3851aa..c117cd0 100644
--- a/src/encoding.rs
+++ b/src/encoding.rs
@@ -42,10 +42,10 @@ pub fn from_ucs_2_bom(bytes: &[u8]) -> Option<String> {
Some(res)
}
-// pub fn from_utf8_mistaken_as_latin1(latin1: &str) -> Option<String> {
-// guard!(latin1.chars().all(|c| (c as usize) < 256));
-// match std::str::from_utf8(latin1.as_bytes()) {
-// Ok(res) => Some(res.to_string()),
-// Err(_) => None,
-// }
-// }
+pub fn from_utf8_mistaken_as_latin1(latin1: &str) -> Option<String> {
+ guard!(latin1.chars().all(|c| (c as usize) < 256));
+ match std::str::from_utf8(latin1.as_bytes()) {
+ Ok(res) => Some(res.to_string()),
+ Err(_) => None,
+ }
+}