Mail Archives: djgpp-workers/1997/12/05/13:03:10
Randy Maas <randym AT acm DOT org> wrote:
> I also noticed that tolower and toupper use an array. I've used the
> following equations before, although I'm sure if they cover all the cases
> of the array...
> # define my_tolower(c) (isupper(c)?('a'-1+((c)&31)):(c))
> # define my_toupper(c) (islower(c)?(((c)&31)-'a'+1):(c))
The arrays are much better to support internationalization. In fact my editor
supports a lot of code pages and adjust toupper and tolower according to the
code page touching the DJGPP arrays.
Think in code pages like 866 (russian) where you have 32 upper and 32 lower
extra characters ;-)
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -