lua-users home
lua-l archive

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

Following the feedback that using UTF8 is better than porting LUA to UTF16, is there a LUA port or library which allows the user to:
- define UTF8 literals;
- open files with UTF8 names;
- read and write Windows unicode text using only LUA strings
- bind with external C code which work in UTF16
Thanks you all!
            Uri Cohen

On Thu, Oct 15, 2009 at 5:48 AM, Andre de Leiradella <> wrote:
I think ICU4Lua adds some support for utf-8 strings to Lua?

Jerome Vuarand wrote:
2009/10/15 uri cohen <>:
I was able to create a UTF16 port of LUA for windows, by following the
guidelines I found at
and the considerations from This is a version of
LUA where all internal strings are UTF16 (wide characters) rather than
chars, not a version with two types of strings like LuaState.

My question is on how can I verify my port works? Other than toy scripts I
created, I'm looking for a comprehensive set of tests I can run in order to
verify all important language feature were not broken...

I think you should make sure your "port" doesn't break libraries that
use strings for non-text data. For examples, you can try to use the io
library on binary files (use one of the (de)serialization libraries
available around), or LuaSocket on binary protocols.

By the way, what's the goal of such a modification of Lua ? If all you
need is being able to use Unicode filenames on windows, a simpler
approach is to assume filenames passed to Lua are in utf-8 format, and
convert it just when necessary when accessing the filesystem (in just
a very few places in Lua source code). I have a patch doing that if
anyone is interested.


           Uri Cohen