tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposal: _ctype_ table bitwidth change



On Tue, 22 Mar 2011, Takehiko NOZAKI wrote:
{
       setlocale(LC_ALL, "en_US.UTF-8");
       printf("isspace:%d\n", isspace((unsigned char)0xA0));
       printf("iswspace:%d\n", iswspace((wchar_t)0xA0));
}

this code print:

isspace:0
iswspace:1

If you want to say "give me the wchar_t value that corresponds to Unicode character U+00A0" then I think you have to use some combination of iconv and mbtowc; as far as I know, you are not allowed to assume anything about the underlying representation of wchar_t, so you can't just cast.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index