lua-users home
lua-l archive

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


>I've been converting a project over to support Unicode as much as possible.
>I've just got to the Lua section of it, and I was surprised to see that, as
>far as I can tell, the Lua code has no support for being passed a Unicode
>block of text, or to execute code that's in a Unicode formatted text file.

Starting with 4.1-alpha, the prototypes for the relevant functions are:

LUA_API int   lua_dofile (lua_State *L, const lua_char *filename);
LUA_API int   lua_dostring (lua_State *L, const lua_char *str);
LUA_API int   lua_dobuffer (lua_State *L, const lua_char *buff, size_t size,

So, lua_char is there for this. Try etc/luser_wchar.h, which defines L_CHAR
to be wchar_t (lua_char is typedef'd as L_CHAR).
--lhf