diff --git a/src/mystring.c b/src/mystring.c index 6fcb07d..7f584a0 100644 --- a/src/mystring.c +++ b/src/mystring.c @@ -336,8 +336,10 @@ shell_quote(const char *s, int style) } /* } */ #ifdef WITH_LOCALE if (!iswprint(c) || (c != ' ' && iswblank(c))) { - if (c < 128) + if (q - p == 1) { + c = (unsigned char) *p; goto oct; + } fmt = c >= 0x10000 ? "\\U%08x" : "\\u%04x"; goto fmt; }