1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-29 05:21:00 +01:00

23177: better formatting of unprintable multibyte characters under 256

This commit is contained in:
Peter Stephenson 2007-02-14 16:26:41 +00:00
parent f35ee0d1a0
commit d283709363
2 changed files with 8 additions and 1 deletions

View file

@ -514,10 +514,12 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
sprintf(buf, "\\U%.8x", (unsigned int)c);
if (widthp)
*widthp = 10;
} else {
} else if (c >= 0x100) {
sprintf(buf, "\\u%.4x", (unsigned int)c);
if (widthp)
*widthp = 6;
} else {
return nicechar((int)c);
}
if (swidep)
*swidep = buf + *widthp;