From: Markus Triska Date: Wed, 3 May 2023 21:23:53 +0000 (+0200) Subject: FIXED: consistent read/write of further control characters, and non-breaking space X-Git-Tag: v0.9.2~123^2~24 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=47d4e6d2f99de18df627a6dcbd52fc7d851b845b;p=scryer-prolog.git FIXED: consistent read/write of further control characters, and non-breaking space Example: ?- X = '\xa0\'. X = '\xa0\'. This addresses #1768. --- diff --git a/src/heap_print.rs b/src/heap_print.rs index 2a2149d2..df22113c 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -172,7 +172,9 @@ 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. + '\u{0}'..='\u{1f}' | '\u{7f}' ..= '\u{a0}' + // print all other control characters, and also non-breaking space, in hex. + => format!("\\x{:x}\\", c as u32), _ => c.to_string(), } }