setlocale howto

Kostik Belousov kostikbel at gmail.com
Sat Aug 12 15:54:39 UTC 2006


On Sat, Aug 12, 2006 at 05:51:01PM +0400, Andrey V. Elsukov wrote:
>     for(i = 0; i < sizeof(buf); i++)
>         buf[i] = (char)toupper(buf[i]);

         buf[i] = (char)toupper((unsigned char)buf[i]);
Standard integer promotion promotes KOI8-R char codes like 0xd4 into 0xffffffd4.
Since such codepoints are not defined for KOI8-R, toupper returns them
unchaged, as specified in documentation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060812/66c1599e/attachment.pgp


More information about the freebsd-stable mailing list