setlocale howto

Andrey V. Elsukov bu7cher at yandex.ru
Sat Aug 12 16:58:40 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.

Thanks, this works! But why this example works on Linux without type conversions?

-- 
WBR, Andrey V. Elsukov


More information about the freebsd-stable mailing list