lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Lua expects code to be in ASCII except inside string literals.
> 
> In long strings (delimited by [[…]]) almost anything goes … with one
> exception: end-of-line.  Another system's EOL is converted to your
> system's EOL.
> 
> That is precisely the behaviour you want when the long string contains
> some UTF-8 text; I can't speak for UTF-16. But it does mean that the
> only way of reliably entering *arbitrary* strings as literals is to
> enter them as short strings with non-ASCII characters escaped.

Just to clarify: this is true for *arbitrary* (binary) strings. UTF-8
strings, not being arbitrary, can be used inside any kind of literal in
Lua ('...', "...", [[...]]) and also in comments without any problems.

-- Roberto