tech-userlevel archive

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

Re: 16bit ctype table



Takehiko NOZAKI <takehiko.nozaki <at> gmail.com> writes:

> > ftp://ftp.netbsd.org/pub/NetBSD/misc/tnozaki/patch-insufficient_ctype_bits

It’s not insufficient. 8 bits are enough.

/* from Bruno Haible's libutf8 */

/* How the 12 character attributes are encoded in 8 bits: Every attribute is
   represented by an "include bitmask" and an "exclude bitmask".
    Attribute   bit/formula             comment
     upper      upper && !lower         implies towlower(x) != x == 
towupper(x)
     lower      !upper && lower         implies towlower(x) == x != 
towupper(x)
     title      upper && lower          implies towlower(x) != x != 
towupper(x)
     alpha      bit                     superset of upper || lower
     digit      xdigit && !alpha        '0'..'9' and more
     xdigit     bit                     '0'..'9','a'..'f','A'..'F' and more
     space      bit                     ' ', '\f', '\n', '\r', '\t', '\v'
     print      bit
     graph      print && !space
     blank      bit                     ' ', '\t'
     cntrl      bit                     0x00..0x1F,0x7F
     punct      print && !(alpha || xdigit || space)
     alnum      alpha || xdigit
*/

See https://www.mirbsd.org/cvs.cgi/src/lib/libc/include/mir18n.h?rev=HEAD

bye,
//mirabilos



Home | Main Index | Thread Index | Old Index