Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: help builtin generates unaligned results for multicolumn widechars. Date: Tue, 25 Aug 2015 10:30:43 -0400 Lines: 34 Approved: bug-bash@gnu.org Message-ID: References: Reply-To: chet.ramey@case.edu NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1440513057 1190 208.118.235.17 (25 Aug 2015 14:30:57 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: "Mingye Wang (Arthur2e5)" , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: X-Junkmail-Status: score=10/50, host=mpv5.cwru.edu X-Junkmail-Whitelist: YES (by domain whitelist at mpv2.tis.cwru.edu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 129.22.105.37 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11438 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/22/15 9:59 AM, Mingye Wang (Arthur2e5) wrote: > 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. Thanks. I made some changes along these lines that will be in the next push to the devel branch. Chet - -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlXcfAoACgkQu1hp8GTqdKu7SQCfbDVrAq0/pnrLBLdOD2XLv39o 04kAoII1J+A+j4jYx9Qu/0XaiVt1uXYE =uzw9 -----END PGP SIGNATURE-----