bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help builtin generates unaligned results for multicolumn widechars.


From: Mingye Wang (Arthur2e5)
Subject: help builtin generates unaligned results for multicolumn widechars.
Date: Sat, 22 Aug 2015 21:59:09 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Thunderbird/40.0

Version: <= 4.4-alpha

In bash's `help.def' builtin, wdispcolumn() is used to display `help'
columns. It terminates the string at wcstr[width - 1], with a comment
that assmues each wide character to be exactly one column wide.

This works fine with most languages where widechars are, actually, one
column wide. But with East Asian languages, more specifically Chinese,
Japanese & Korean, it would produce terrible results.

Maybe bash should consult wcswidth(wcstr+1,displen), or get the `len' in
wcsnwidth() changed to some additional int* argument to store it, and
consider the the difference between the real width and displen.

-- 
Regards,
Arthur2e5 (0x222D7BDA)


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]