lua-users home
lua-l archive

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


On Mon, Dec 04, 2006 at 04:05:46PM -0200, Roberto Ierusalimschy wrote:
> My question is, what is the "best" way to check char classes? Should I
> use mbtowc + iswctype? A hand-written utf8->wchat_t + iswctype?

I gather there is no "best" way.
The way slnunicode does it is optimized for size,
using a higly compressed unicode character class table (from Tcl)
and never requiring space for a UTF-16 version (unlike Tcl).

Anyway, wchar_t can be expected to do the job only in
implementations defining __STDC_ISO_10646__
- else it might be a 16bit value, which means trouble.


regards
Klaus