>From 50eade1e10127bbbdaa8496822ce26061a75ab8c Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Tue, 5 Mar 2013 18:48:44 +0100 Subject: [PATCH 1/3] write: escape DEL character in strings, encode BEL as \a Encode DEL (ASCII character 127) in strings as \x7f instead of as literal DEL in write. Also encode BEL (ASCII character 7) as \a instead of \x07, for consistency. Signed-off-by: Peter Bex --- library.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library.scm b/library.scm index f11a4ee..5a2862e 100644 --- a/library.scm +++ b/library.scm @@ -3310,15 +3310,17 @@ EOF ((34) (outstr port "\\\"")) ((92) (outstr port "\\\\")) (else - (cond ((fx< chr 32) + (cond ((or (fx< chr 32) + (fx= chr 127)) (outchr port #\\) (case chr + ((7) (outchr port #\a)) + ((8) (outchr port #\b)) ((9) (outchr port #\t)) ((10) (outchr port #\n)) - ((13) (outchr port #\r)) ((11) (outchr port #\v)) ((12) (outchr port #\f)) - ((8) (outchr port #\b)) + ((13) (outchr port #\r)) (else (outchr port #\x) (when (fx< chr 16) (outchr port #\0)) -- 1.8.0.1