isUpperCase(), anyone?

Kjetil Rå Hauge k.r.hauge at east.uio.no
Sat Aug 9 05:55:00 EDT 2003


Is there any way to do a simple Unicode-compliant check of whether a 
character is uppercase? I figured that this would do it:

function isUpper x
       set the useUnicode to true
        --must be uppercase if the lowercased x is not equal to the original x:
         return charToNum(x) <>charToNum(toLower(x))
end isUpper

- but the problem seems to be in the toLower (and toUpper) functions. 
The documentation says:

toLower("NO, MAÑANA!") -- returns "no, mañana!"

but both in 2.02  and 2.1b2 (Mac OS X), it returns "no, maÑana!" . 
Even Microsoft Word with its poor Unicode support can do ChangeCase 
with Cyrillic and CE, so it should be possible.

CharToNum() works fine with Unicode, so I suppose I could check if it 
returns a number corresponding to an uppercase glyph (I don't need 
conversion, only detection), but as these partly come in ranges, 
partly in pairs with lowercase, it is not an appealing option.
-- 
--- Kjetil Rå Hauge, U. of Oslo. Tel. +47/22856710, fax +47/22854140
--- (this msg sent from home, +47/67148424, fax +1/5084372444)



More information about the use-livecode mailing list