Luasocket help: How to send utf-8 string(e.g. 0x10)

Hi guys,
I am new to Lua. I want to implement an client-side code for an online game. The snip code as:
c = socket:connect()
c:send(data) – Data is the string to be sent

Due to the protocol between server and client, i must make sure send and receive UTF-8 string, but the parameter data of client:send must be string.
The string is descripted in Lua document as:
“Strings in Lua have the usual meaning: a sequence of characters. Lua is eight-bit clean and its strings may contain characters with any numeric code, including embedded zeros. This means that you can store any binary data into a string.”
How can i address the utf-8 string in Luasocket? Anybody could help me!!!
Thanks [import]uid: 100695 topic_id: 18548 reply_id: 318548[/import]

Hey there,

See this discussion; http://forum.luahub.com/index.php?topic=2694.0

A bunch more info; http://lua-users.org/wiki/LuaUnicode

Peach :slight_smile: [import]uid: 52491 topic_id: 18548 reply_id: 71327[/import]

I got it. Thank you very much. [import]uid: 100695 topic_id: 18548 reply_id: 71429[/import]

Not a problem, best of luck with your project.

Peach :slight_smile: [import]uid: 52491 topic_id: 18548 reply_id: 71495[/import]