]> Repositorios git - scryer-prolog.git/commitdiff
FIXED: consistent read/write of further control characters, and non-breaking space
authorMarkus Triska <[email protected]>
Wed, 3 May 2023 21:23:53 +0000 (23:23 +0200)
committerMark <[email protected]>
Fri, 23 Jun 2023 20:11:31 +0000 (14:11 -0600)
Example:

    ?- X = '\xa0\'.
       X = '\xa0\'.

This addresses #1768.

src/heap_print.rs

index 2a2149d285f4c6242282ddc2aac9e375caa5c9e4..df22113c5c692d36acbb15ca18825fe4693eb616 100644 (file)
@@ -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(),
     }
 }