lua-users home
lua-l archive

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


> What issues would be involved getting lua to natively use the 
> MS Windows 
> 16-bit unicode effort? I know its a little (well quite a lot :) ) 
> against the spirit of lua, but it seems like a good quick fix 
> just to go 
> through the lua source and replace all the str* function calls with 
> win32 wstr* calls. Of course all scripts would have to be 
> saved into the 
> same 16-bit text files in this situation.
> 
> Just to make clear (and avoid flames) I wouldn't consider 
> this a proper 
> fix but just a quick way to get win32 unicode support into lua.

If you need functionality very similar to what you describe now, hop on
over to http://workspacewhiz.com/ and click on the Misc. Code sidebar
link.  You'll see two Lua distributions... LuaState 4.1 Alpha was used
to ship the Xbox title Amped: Freestyle Snowboarding.  I built a wide
character "Unicode" string type into it.  LuaPlus 5.0 Alpha is based on
the Lua 5.0 alpha codebase and has the same Unicode type.  Note that the
string type is a true Lua string type.  That is, I can write:

myString = L"This is a Unicode string"
myString = myString .. ", and it can use regular string operations."
print(myString:len())

myAnsiString = L"This is an ANSI string"
print(myAnsiString:len())

-Josh