Hi,
I have started creating bindings to libunistring [1]. The main interest for me is UTF-8 (I'm not really interested in other representations). The library for OpenResty is called lua-resty-unistring [2] (although it should work just fine with LuaJIT too -> only thing that is OpenResty dependend is utf8.slug function).
I have already made bindings for several libunistring functions such as:
1. utf-8 case-conversions [3]
2. unicode name to unicode char conversions [4]
3. utf-8 normalization [5]
4. utf-8 stdio functions [6]
5. utf-8 string functions [7]
6. utf-8 char width functions [8]
These are alright but they are quite a low level. For normal (more high level) use I have also started utf8 lib [9]. I'm looking at implementing Lua 5.3 utf8 library 1:1 to OpenResty and LuaJIT 2.x (which is Lua 5.1 + some features from 5.2). So far I have managed to implement these:
1. utf8.char-function
2. utf8.charpattern (just a string field)
3. utf8.len
utf8.codes, utf8.codepoint, and utf8.offset is still work in progress, but I have also added some Lua's string-library functions to utf8 library like:
1. utf8.lower
2. utf8.upper
And then some handy functions like:
1. utf8.slug (generates slugs from strings)
2. utf8.split (splits the strings)
3. utf8.starts (checks the prefix)
4. utf8.ends (checks the suffix)
5. utf8.title (title casing)
Please test them out and send pull requests, :-) Other than that I also made bindings to TagLib [10] here [11] (only the abstract C API for now).
Yes, the documentations sucks, but it will get better in a future. I hope that you find these useful.
Regards
Aapo
[1] https://www.gnu.org/software/libunistring/
[2] https://github.com/bungle/lua-resty-unistring/
[3] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/case.lua
[4] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/name.lua
[5] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/norm.lua
[6] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/stdio.lua
[7] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/str.lua
[8] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/width.lua
[9] https://github.com/bungle/lua-resty-unistring/blob/master/lib/resty/unistring/utf8.lua
[10] http://taglib.github.io/
[11] https://github.com/bungle/lua-resty-taglib