[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Lua interpreter and Lua files encoding
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Thu, 06 Jan 2011 00:05:41 +0100
For some weeks I've been playing with Lua and LaTeX. More specifically I
use Lua to generate LaTeX files.
Since I need to generate LaTeX files encoded in utf8, the Lua files used
to generate them are utf8 too, so I can embed fragments of utf8 text in
string literals, which I then assemble to build the final LaTeX file.
I never had any problem with this approach by now, but having struggled
for a while with LaTeX input/font encoding mess, I was struck by a
doubt: does the Lua interpreter really support utf8? And to what extent?
Or I was only lucky because my string literals didn't contained fancy
unicode chars, but only accented latin letters? I also did some testing
embedding arabic chars in Lua literals and they showed up correctly in
LaTeX files, so it seems it works.
I know that Lua in itself isn't Unicode compliant, but does the
interpreter behave well if the only non-ASCII Unicode chars are in
string literals (and in comments sometimes)? Is it a guaranteed behaviour?
I didn't found anything in the manual in this respect (beside the fact
that Lua is 8-bit clean). I also searched the mailing list archive, but
didn't find a definitive answer.
I begin to fear that I'm relying on undefined behaviour!
Thanks in advance for any explanation.