The Mac doesn't support "C.UTF-8" (and toybox ignores the setlocale(3)
failure), leading to numerous test failures because wcwidth(3)
always returns -1 for non-ASCII in the default C locale.

Our choices are:
1. Always use "" (the environment).
2. Always use "en_US.UTF-8" (the closest to "C.UTF-8" supported on Macs).
3. Continue to use "C.UTF-8" elsewhere but one of the above on Macs.

I've gone with #1 because it's the default advice for setlocale(3),
and it's probably closest to the user's intentions. Every OS I'm
aware of has $LANG set to <something>.UTF-8 these days, and has
done for a decade now.

Note though that we'd also need to change LC_CTYPE to LC_ALL if we
also want strerror(3) to be localized. For now, despite this
setlocale(3) call, you'll still get "C" locale error messages.

---
 main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Attachment: 0001-Fix-wcwidth-3-on-Mac.patch
Description: Binary data

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to