Lua的Unicode函数

抱歉如果这个问题已经被问过了,但是Lua内置的字符串函数(例如 string.lenstring.sub)不太能很好地处理Unicode字符,那么是否有替代方案呢?

点赞
用户1442917
用户1442917

有各种库可用来实现这个功能,例如:https://github.com/alexander-yakushev/awesompd/blob/master/utf8.lua。此外,Lua 5.3+也支持一些 utf8 相关的函数:https://www.lua.org/manual/5.3/manual.html#6.5

2019-12-20 06:09:04