NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/57798: With src/share/locale/ctype/en_US.UTF-8.src, wcwidth() returns 3 when ja_JP.UTF-8 locale is used
>Number: 57798
>Category: lib
>Synopsis: With src/share/locale/ctype/en_US.UTF-8.src, wcwidth() returns 3 when ja_JP.UTF-8 locale is used
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 27 12:45:00 +0000 2023
>Originator: Ryo ONODERA
>Release: NetBSD 10.99.10
>Organization:
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3
>Environment:
System: NetBSD castella 10.99.10 NetBSD 10.99.10 (DTRACE9) #0: Mon Dec 25 05:18:50 JST 2023 ryoon@castella:/usr/world/10.99/amd64/obj/sys/arch/amd64/compile/DTRACE9 amd64
Architecture: x86_64
Machine: amd64
>Description:
The following test program prints 3 for å?? character.
=== === === === === === === === === === === === === === === ===
#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <locale.h>
int
main(void)
{
const char *str = "å??";// -> 3, should be 2
setlocale(LC_ALL, "ja_JP.UTF-8");
//setlocale(LC_ALL, "C");
wchar_t cp;
int len = mbtowc(&cp, str, 5);
if (len < 1)
return -1;
int w = wcwidth(cp);
printf("w = %d\n", w);
return 0;
}
=== === === === === === === === === === === === === === === ===
TODIGIT < 0x5146 1000000000000 >
in
src/share/locale/ctype/en_US.UTF-8.src
was introduced in r1.8 and it seems that it makes wcwidth of å?? character as 3.
>How-To-Repeat:
>Fix:
I have no idea.
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index