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:
parent
f35ee0d1a0
commit
d283709363
2 changed files with 8 additions and 1 deletions
|
|
@ -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>
|
2007-02-14 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* 23169 (tweaked): Src/exec.c: upon failure to duplicate file
|
* 23169 (tweaked): Src/exec.c: upon failure to duplicate file
|
||||||
|
|
|
||||||
|
|
@ -514,10 +514,12 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep)
|
||||||
sprintf(buf, "\\U%.8x", (unsigned int)c);
|
sprintf(buf, "\\U%.8x", (unsigned int)c);
|
||||||
if (widthp)
|
if (widthp)
|
||||||
*widthp = 10;
|
*widthp = 10;
|
||||||
} else {
|
} else if (c >= 0x100) {
|
||||||
sprintf(buf, "\\u%.4x", (unsigned int)c);
|
sprintf(buf, "\\u%.4x", (unsigned int)c);
|
||||||
if (widthp)
|
if (widthp)
|
||||||
*widthp = 6;
|
*widthp = 6;
|
||||||
|
} else {
|
||||||
|
return nicechar((int)c);
|
||||||
}
|
}
|
||||||
if (swidep)
|
if (swidep)
|
||||||
*swidep = buf + *widthp;
|
*swidep = buf + *widthp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue