aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/slibc-human/escape.c4
1 files changed, 3 insertions, 1 deletions
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++ = '\\',