Note that this only works for a-z / A-Z.
This is because in UTF-8 a-z are encoded in one octet (1 byte, or one pascal "char").
This is part of UTF-8
- The ASCII chars (ordinary value below 128 (excluding 128)) are the same
- no other codepoint (char) in utf-8 contains an octet (byte) with a value between 0 and 127.
"string[x]" and/or the "in" operator will not work if you need to find upper/lower umlauts äöü/ÄÖÜ. The same for accented chars, or the Turkish uppercase dotted I, or lowercase not-dotted i. And of course not, if you look at other scriptures.
Then you can get a codepoint (google/search the forum - not the same as a char) using Utf8Copy, Utf8Pos, (IIRC) Utf8CodePointLenght....
"Ord" will not work on them, as the return strings (codepoints are stored as strings). But the utf8 helper units may have a function to get the value of such a codepoint.
Alternative you can convert to utf16, or utf32. But you still work with codepoints, not chars. And in case of utf16 there are also surrogates. But they do probably not pertain to the upper/lowercase issue. (They are for real exotic stuff like Egyptian hieroglyphs. Not sure if any of those have an upper/lower distinction ;) )