From ac5d71625ed978e552d16be44b739e2f9a1e8e6f Mon Sep 17 00:00:00 2001 From: Hadrien G Date: Sat, 5 May 2018 17:38:56 +0200 Subject: [PATCH] Use unknown char marker for out-of-range chars The empty string "" translation is a bit unfortunate as it loses information. Although it cannot always be easily avoided, in the case of out-of-range characters it seems easy to do so. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d766bc2..2392de4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,5 +69,5 @@ pub fn unidecode(s: &str) -> String { /// ``` #[inline] pub fn unidecode_char(ch: char) -> &'static str { - MAPPING.get(ch as usize).map(|&s| s).unwrap_or("") + MAPPING.get(ch as usize).map(|&s| s).unwrap_or("[?]") }