views:

488

answers:

3

Based on the link below, I'm confused as to whether the Lua programming language supports Unicode.

http://lua-users.org/wiki/LuaUnicode

It appears it does but has limitations. I simply don't understand, are the limitation anything big/key or not a big deal?

A: 

It supports it in the sense that you can use Unicode in Lua strings. It depends specifically on what you're planning to do, but most of the limitations can be fairly easily worked around by extending Lua with your own functions.

Dean Harding
+4  A: 

If you want a short answer, it is 'yes and no' as put on the linked site.

Lua supports Unicode in the way that specifying, storing and querying arbitrary byte values in strings is supported, so you can store any kind of Unicode-encoding encoded string in a Lua string.

What is not supported is iteration by unicode character, there is no standard function for string length in unicode characters etc. So the higher-level kind of Unicode support (like what is available in Python with length, lower -> upper case conversion, encoding in arbitrary coding etc) is not available.

kaizer.se
Note there is links at bottom of http://lua-users.org/wiki/LuaUnicode for higher-level Unicode support.
grom
A: 

Lua does not have any support for unicode (other than accepting any byte value in strings). The library slnunicode has a lot of unicode string functions, however. For example unicode.utf8.len.

(note: this answer is completely stolen from grom's comment on another question - I just think it deserves its own answer)

Johannes Hoff