1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-29 17:31:02 +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

@ -1,3 +1,8 @@
2007-02-14 Peter Stephenson <pws@csr.com>
* 23177: Src/utils.c: print unprintable characters under
256 in \M- format even in multibyte mode.
2007-02-14 Barton E. Schaefer <schaefer@zsh.org>
* 23169 (tweaked): Src/exec.c: upon failure to duplicate file

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;