summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-12 06:33:43 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-12 06:33:43 -0800
commitd8b8365eb2f40cf3bad1815c349faa6e0b5aab93 (patch)
treedb3781c5af62a80b1b16503719d80864b250ef62 /lib.c
parent5f9fd6726e36b4746acb5a098d5c1c2582c19d91 (diff)
downloadtxr-d8b8365eb2f40cf3bad1815c349faa6e0b5aab93.tar.gz
txr-d8b8365eb2f40cf3bad1815c349faa6e0b5aab93.tar.bz2
txr-d8b8365eb2f40cf3bad1815c349faa6e0b5aab93.zip
Pretty-print DEL and U+DCxx str char using \xHEX.
* lib.c (out_str_char): Don't print all characters above space as themselves. Treat 7F and U+DCxx as control chars to be printed using hex escape.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 245c0d3a..d6952482 100644
--- a/lib.c
+++ b/lib.c
@@ -8283,7 +8283,7 @@ static void out_str_char(wchar_t ch, val out, int *semi_flag)
case '\\': put_string(lit("\\\\"), out); break;
case 27: put_string(lit("\\e"), out); break;
default:
- if (ch >= ' ') {
+ if ((ch >= ' ' && ch != 127 && ch < 0xDC00) || ch > 0xDCFF) {
put_char(chr(ch), out);
} else {
format(out, lit("\\x~,02X"), num(ch), nao);