Path: csiph.com!xmission!news.alt.net!nntp.club.cc.cmu.edu!169.228.66.3.MISMATCH!ihnp4.UCSD.Edu!usenet.stanford.edu!not-for-mail From: "Mingye Wang (Arthur2e5)" Newsgroups: gnu.bash.bug Subject: help builtin generates unaligned results for multicolumn widechars. Date: Sat, 22 Aug 2015 21:59:09 +0800 Lines: 50 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3AXbBbHATjPmDje1uvcXdT0Mcu3oKTXVb" X-Trace: usenet.stanford.edu 1440251977 15835 208.118.235.17 (22 Aug 2015 13:59:37 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-TMN: [g/9dqn4VV82d2RjbMvw8gaxnx27EV/f7] X-Originating-Email: [arthur200126@hotmail.com] X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Thunderbird/40.0 X-OriginalArrivalTime: 22 Aug 2015 13:59:27.0760 (UTC) FILETIME=[C27F8100:01D0DCE2] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 65.55.116.102 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:11425 --3AXbBbHATjPmDje1uvcXdT0Mcu3oKTXVb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Version: <=3D 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. --=20 Regards, Arthur2e5 (0x222D7BDA) --3AXbBbHATjPmDje1uvcXdT0Mcu3oKTXVb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJV2IAzAAoJEK4jzpUiLXvao0oP/0ckVczDWypWr9P26COR91At uWI9iMg2Q+bnBCxzohwEJ4LEAf3BhnL5gCa5irTZ0o74VTiTQ3KFYn4A7X5Aoe0U mZlxbYI5/GXkcnwPE6auEUoyL30f7m+33p7jR5L8hbT5UYp+aYns1mEOhO7i2lbM yYMY7KlYYwkXv2ZDfOvGcNXAPESS5W42VzEfO/k1YNibl/cX3DlLcUpeAV9O0L6o MLoV3q2BsFZtR27FoO9WtWYdlEMgghG6sVp9uPSxZ8s71eyqpH06qgcNo0qPDxLB DV9GJaaYTOYlWnRc5ZfJ2WYYDWiWLKEXA9TRlvXwXOxKQve3nUTJ9hesECWjLIMJ c8EF0yhbSX5RjbJL5X9b9sqV3EFXV4bzGc4A3bE4C8jMDkXDAZkeZ3qpvYZ0+QQH JmLaiBhIXiAIwQcxKZoSz+EV2AXb3b5+lYO29JuGKSNCJ+EjYNwz1qPs4dxl7LzJ fIzRUOsJkpatMYobD0ah4IMOhUaiXzn0D+ZKNh1AhqwpVbECpU4HCFd5B8wFIf+0 FG1kQzUMLZGvSWqD3LsBN18CT/LeqzwV1mJ4c0g4ZOU5tHkNzuni8+QZdjy5BnGp C8XEyNzxCZJDfyd2SgSQRvX/fxQhGbHWan34cVsiqUsWdULzVAMJnPPOFyBrMRW5 k0l1JVHMAmL8nFoZnmGd =Iu/0 -----END PGP SIGNATURE----- --3AXbBbHATjPmDje1uvcXdT0Mcu3oKTXVb--