lua 5.1 translate utf8 russian characters to unicode?

654 views Asked by At

Hello I am wondering if it is possible to translate Привет into \u041f\u0440\u0438\u0432\u0435\u0442 in lua 5.1. There is no utf8 library, nor no unicode library inside this game. I've looked for a library on github that does this for me, but I can't find one that is suited for this

1

There are 1 answers

0
noobyy On

https://github.com/perfgao/lua-resty-unicode/blob/master/lib/resty/unicode.lua

utf8_to_unicode("Привет")
>"\u041f\u0440\u0438\u0432\u0435\u0442"