Simple UTF8 support in pure lua
The module emulate the string capabilities
string.bytestring.charstring.dumpstring.findstring.formatstring.gmatchstring.gsubstring.lenstring.lower(*)string.matchstring.repstring.reversestring.substring.upper(*)
(*) don't thread Unicode, only ascii upper/lower cases.
localu=require("utf8string")
localdata="àbcdéêèf"localudata=u(data)
print(type(data), data) -- the orignalprint(type(udata), udata) -- automatic convertion to stringprint(#data) -- is not the good number of printed characters on screenprint(#udata) -- is the number of printed characters on screenprint(udata:sub(4,5)) -- be able to use the sub() like a string- See all other utf8 implementation
- Try to follow the lua5.3's utf8 API
- ...
My code is under MIT License