NetBSD-Bugs archive

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

Re: lib/57798: With src/share/locale/ctype/en_US.UTF-8.src, wcwidth() returns 3 when ja_JP.UTF-8 locale is used



The following reply was made to PR lib/57798; it has been noted by GNATS.

From: Ryo ONODERA <ryo%tetera.org@localhost>
To: Rin Okuyama <rokuyama.rk%gmail.com@localhost>, Valery Ushakov <uwe%stderr.spb.ru@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: lib/57798: With src/share/locale/ctype/en_US.UTF-8.src,
 wcwidth() returns 3 when ja_JP.UTF-8 locale is used
Date: Thu, 28 Dec 2023 13:27:53 +0900

 Hi,
 
 Rin Okuyama <rokuyama.rk%gmail.com@localhost> writes:
 
 > On 2023/12/27 22:52, Valery Ushakov wrote:
 >> On Wed, Dec 27, 2023 at 22:52:04 +0900, Rin Okuyama wrote:
 >> 
 >>> https://github.com/OpenBSD/src/commit/4efe9bdeb34
 >>>
 >>> If this commit is mechanically applied to netbsd-10,
 >>> wcwidth(3) correctly reports 2 for U+5146.
 >> 
 >> Please, can you leave a comment somewhere around the new "DIGITMAP
 >> mapignore" rule that mentions that we now ignore this information, so
 >> that it's obvious without consulting the version history?
 >> 
 >> And of course s/Ox/Nx/ in the man page diff.
 >
 > Thank you uwe@ for careful review!
 >
 > I've committed it to -current. Let us see what happens for a while.
 >
 > It would be nice if we can pull this up (in some form) to netbsd-10,
 > but I'm afraid there's no enough time left before 10.0 release...
 >
 > ryoon@, do you have some ideas to test this change? For what
 > application have you encountered this problem? Is it fixed now
 > without regression?
 
 TODIGIT for U+5146 and similar Kanji characters are always useless
 for me.
 
 I have forgotten to mention in the original PR, tmux in NetBSD base
 (/usr/bin/tmux) is affected by this problem.
 If you set LANG=ja_JP.UTF-8 and start tmux and display 兆 character
 in the tmux window, tmux exits unexpectedly with '[server exited unexpectedly]'
 error message. And all tmux sessions will be lost.
 Recent tmux assumes wcwidth always returns <= 2.
 
 See: 'ud->width >2' in utf8_from_data() in src/external/bsd/tmux/dist/utf8.c
 
 /* Get UTF-8 character from data. */
 enum utf8_state
 utf8_from_data(const struct utf8_data *ud, utf8_char *uc)
 {
         u_int   index;
 
         if (ud->width > 2)
                 fatalx("invalid UTF-8 width: %u", ud->width);
 
 
 Thank you.
 
 > Thanks,
 > rin
 
 -- 
 Ryo ONODERA // ryo%tetera.org@localhost
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 



Home | Main Index | Thread Index | Old Index