]> Repositorios git - scryer-prolog.git/commitdiff
print most characters directly ((#1355)
authorMark Thom <[email protected]>
Fri, 18 Mar 2022 00:43:30 +0000 (18:43 -0600)
committerMark Thom <[email protected]>
Fri, 18 Mar 2022 00:43:30 +0000 (18:43 -0600)
src/heap_print.rs

index 944b30d86e321bd44f7b21f705808bb473024b2b..7d00c0d0eca505a0c105d4adfe146168b3dd620c 100644 (file)
@@ -176,11 +176,15 @@ fn char_to_string(is_quoted: bool, c: char) -> String {
         '\'' | '\n' | '\r' | '\t' | '\u{0b}' | '\u{0c}' | '\u{08}' | '\u{07}' | '"' | '\\' => {
             c.to_string()
         }
+        '\u{0}'..='\u{1f}' => format!("\\x{:x}", c as u32), // print all other control characters in hex.
+        _ => c.to_string(),
+        /*
         '\u{a0}'..='\u{d6}' => c.to_string(),
         '\u{d8}'..='\u{f6}' => c.to_string(),
         '\u{f8}'..='\u{74f}' => c.to_string(),
         '\x20'..='\x7e' => c.to_string(),
         _ => format!("\\x{:x}\\", c as u32),
+        */
     }
 }