Ascii character code 127 (DEL) is not printable.

This commit is contained in:
Markus F.X.J. Oberhumer 2017-05-16 18:09:24 +02:00
commit 87888e8129
2 changed files with 2 additions and 2 deletions

View file

@ -215,7 +215,7 @@ proc rspaces(x: int): Rope =
proc toYamlChar(c: char): string = proc toYamlChar(c: char): string =
case c case c
of '\0'..'\x1F', '\x80'..'\xFF': result = "\\u" & strutils.toHex(ord(c), 4) of '\0'..'\x1F', '\x7F'..'\xFF': result = "\\u" & strutils.toHex(ord(c), 4)
of '\'', '\"', '\\': result = '\\' & c of '\'', '\"', '\\': result = '\\' & c
else: result = $c else: result = $c

View file

@ -220,7 +220,7 @@ proc makeLLVMString*(s: string): Rope =
add(result, rope(res)) add(result, rope(res))
setLen(res, 0) setLen(res, 0)
case s[i] case s[i]
of '\0'..'\x1F', '\x80'..'\xFF', '\"', '\\': of '\0'..'\x1F', '\x7F'..'\xFF', '\"', '\\':
add(res, '\\') add(res, '\\')
add(res, toHex(ord(s[i]), 2)) add(res, toHex(ord(s[i]), 2))
else: add(res, s[i]) else: add(res, s[i])