My script has a functional requirement: I search all actor(hero) names in the game, then I want to show the user a list of names,the user selects one of them.The script performs subsequent operations based on this selection.
My question is : How to convert byte arrays to text(string)?
In Java, His effect is similar to :
String content = new String(bytes, "UTF-16LE");
How to do this in Lua Script?
I know "string.char" can decode UTF-8, but when the code is UTF-16LE, the text is garbled.(My game language is Chinese).I see some code that can be implemented, but that requires bit operation on Lua53.
Who can give me some suggest,or some tools and methods that can run on Lua52
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
ctbear
My script has a functional requirement: I search all actor(hero) names in the game, then I want to show the user a list of names,the user selects one of them.The script performs subsequent operations based on this selection.
My question is : How to convert byte arrays to text(string)?
In Java, His effect is similar to :
String content = new String(bytes, "UTF-16LE");
How to do this in Lua Script?
I know "string.char" can decode UTF-8, but when the code is UTF-16LE, the text is garbled.(My game language is Chinese).I see some code that can be implemented, but that requires bit operation on Lua53.
Who can give me some suggest,or some tools and methods that can run on Lua52
Thanks.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.