tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: uricode.c problem
Date Fri, 28 Dec 2001 16:50:04 GMT
davidw@dedasys.com (David N. Welton) writes:

> davidw@dedasys.com (David N. Welton) writes:
> 
> > Maybe we should try some trickery with the comparison, so that we
> > can just use the default 'char *' type...
> 
> if (utf[0] > (CHAR_MAX - 127)) {

Stupid... 

if (!(utf[0] & 0x80) && utf[0] != 0) {

This doesn't care if it's signed or not - if it's an 8 bit character,
and not == 0, it gets shuffled off to the right place.

Committed.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Mime
View raw message