diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1375,11 +1375,15 @@ str_inspect(str) while (p < pend) { UCHAR c = *p++; - if (ismbchar(c) && p < pend && ismbchar2(*p)) { + if (ismbchar(c) && p < pend) { CHECK(2); *b++ = c; *b++ = *p++; } + if (c & 0x80) { + CHECK(1); + *b++ = c; + } else if (c == '"') { CHECK(2); *b++ = '\\'; |