This is not so easy to achieve in "pure" Lua. My poor attempt to code it
myself has been described on this list as bogus, wrong, etc. I wish
someone with more knowledge than me had done it — someone who
not only can throw around words like normalization and glyph, but knows
exactly what they mean.
It has normalization, and also pattern matching that treats character classes as equivalent to the similar Unicode categories (e.g. %a = "Letter", %d = "Decimal_Number"). Contributions welcome, but note it has to remain Lua 5.1 compatible.