UTF-8 aware subset of Lua's string module.