lua-users home
lua-l archive

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


On 5/1/2017 3:27 PM, Luiz Henrique de Figueiredo wrote:
>> print("á")
>>
>> When encoded as UTF-8.
>>
>> Looking at the manual, I can't tell whether this is intentional or not.
>> The program, when executed, does seem to function as expected. Can you
>> clarify if this program is intended to be valid Lua?
> 
> Calling print with any string is valid Lua. What you see depends on what
> the string contains and, more to the point, on how the terminal you use
> interprets the contents of the string. Lua is actually completely agnostic
> about the contents of a string: strings are just sequence of bytes.
> 
> So, yes, A Lua program that uses UTF-8 text in Lua strings will work just
> fine, provided you only do I/O with them. The standard string library
> does not work on UTF-8 text. The standard utf8 library helps but does not
> replace the standard string library.

I guess my question wasn't clear enough. I didn't mean to focus on the
print call. I meant to ask whether UTF-8 in comments is intended and
whether UTF-8 in string literals is intended?