From 87888e8129a7162cab546451ee3473d9bc5bbd63 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 16 May 2017 18:09:24 +0200 Subject: [PATCH] Ascii character code 127 (DEL) is not printable. --- compiler/astalgo.nim | 2 +- compiler/ccgutils.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 77108eb7ba..3afb2eaebf 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -215,7 +215,7 @@ proc rspaces(x: int): Rope = proc toYamlChar(c: char): string = 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 else: result = $c diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index c37a8fcdba..c8e742de30 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -220,7 +220,7 @@ proc makeLLVMString*(s: string): Rope = add(result, rope(res)) setLen(res, 0) case s[i] - of '\0'..'\x1F', '\x80'..'\xFF', '\"', '\\': + of '\0'..'\x1F', '\x7F'..'\xFF', '\"', '\\': add(res, '\\') add(res, toHex(ord(s[i]), 2)) else: add(res, s[i])