| Summary: | wcwidth fails to be standards-compliant | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Kiyoshi Aman <kiyoshi.aman> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | REOPENED --- | ||
| Severity: | minor | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | 0.9.32 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
I should note, http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c conforms to standards and is suitably licensed such that it could replace uClibc's implementation. After further discussion, I'm going to take this up with Alpine Linux's libc team due to their disabling of locales. Reopening because it makes no sense for wc(s)width to default to ASCII when locales are disabled. ASCII is not 'widechar' at all, particularly when the existing str* functions in string.h handle ASCII just fine. |
The wcwidth function (and wcswidth, for that matter, since uClibc's wcwidth is implemented in terms of wcswidth) fails to be standards compliant. The following test should emit 'e-acute is 1 wide' on conforming implementations; uClibc's instead emits 'e-acute is -1 wide': #include <stdio.h> #include <wchar.h> void main(void) { printf("e-acute is %d wide\n", wcwidth(0xe9)); }