tech-userlevel archive

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

Re: Proposal: _ctype_ table bitwidth change

> As I wrote earlier, IMO the correct approach is to make the rune table
> the public interface. Drop the current _CTYPE_* macros for anything but
> legacy purposes. Drop them completely after the next major bump.
> chrtbl is dead already and I plan to remove the rest of the libc code
> soonish, it just complicated this without any real gain.

no, _ctype_(for is*) and rune(for isw*) *must* be separated, example:

#include <ctype.h>
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>

        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:


apparently ctype table and wctype table *differ*.

see following FreeBSD's PR:
(they introduced __mb_sb_limit variable, but i think it is kludge)

very truly yours.
Takehiko NOZAKI<>

Home | Main Index | Thread Index | Old Index