From c8037b57598c527c4e08215f518cdb55d04580cd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 14 Nov 2015 16:34:16 +0100 Subject: escape: 192 128 → \0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/slibc-human/escape.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slibc-human/escape.c b/src/slibc-human/escape.c index e3be732..9ba166a 100644 --- a/src/slibc-human/escape.c +++ b/src/slibc-human/escape.c @@ -108,7 +108,9 @@ char* escape(const char* restrict str, char quote) case '\\': *w++ = '\\', *w++ = '\\'; break; case 0x7F: *w++ = '\\', *w++ = '1', *w++ = '7', *w++ = '7'; break; default: - if (c == quote) + if ((unsigned int)c == 0xC0) && ((unsigned int)(r[1]) == 0x80) + *w++ = '\\', *w++ = '0', r++; + else if (c == quote) *w++ = '\\', *w++ = quote; else if (c < ' ') *w++ = '\\', -- cgit v1.2.3-70-g09d2