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



兆 (U+5146) is a Chinese symbol for 1,000,000,000,000.

I've confirmed that wcwidth(3) wrongly returns 3 for U+5146.
while it correctly returns 2 for 億 (U+5140: 100,000,000).

wcwidth(3) also returns 3 for U+16B60 (a Pahawn Hmong
character for 10,000,000,000).

These failures should be due to broken TODIGIT supports in
mklocale(1). Its man page says:

> TODIGIT    Defines a map from runes to their digit value.
>            (snip) Only values up to 255 are allowed.

OpenBSD has already dropped support to TODIGIT from mklocale(1):
https://github.com/OpenBSD/src/commit/4efe9bdeb34

If this commit is mechanically applied to netbsd-10,
wcwidth(3) correctly reports 2 for U+5146.

I will commit it and send a pullup request to netbsd-10,
if there's no objections.

Thanks,
rin


Home | Main Index | Thread Index | Old Index