Page 1 of 1

About the Multibyte language use Lua in CEGUI

Posted: Fri Feb 13, 2009 06:16
by tengdaping
Hello,
I am a programmer from China, and I use CEGUI from the 0.4version, I like it very much.
And when I use the Chinese character to input into the Demo8(for the Demo8, I add the input support for the Chinese character),and it can be displayed correctly in the editbox, but when I click the "Add" button,the characters added into the Listbox is mistaken.
Sorry for my poor English , Who can help me about that? thank you!

Re: About the Multibyte language use Lua in CEGUI

Posted: Fri Feb 13, 2009 08:18
by haihuojiming
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3770

you can read this post.

if u can write the codes in demo8.lue
"
function addItemHandler(args)
local winMgr = CEGUI.WindowManager:getSingleton()

local text = winMgr:getWindow("Demo8/Window1/Controls/Editbox"):getText()
local cols = CEGUI.PropertyHelper:stringToColourRect(winMgr:getWindow("Demo8/Window1/Controls/ColourSample"):getProperty("ImageColours"))

local newItem = CEGUI.createListboxTextItem(text, 0, nil, false, true)
newItem:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
newItem:setSelectionColours(cols)

CEGUI.toListbox(winMgr:getWindow("Demo8/Window1/Listbox")):addItem(newItem)
end
"
to c++ . it will be right. the question is lua do't support the unicode.

Posted: Wed Feb 25, 2009 08:00
by lindquist
I've seen a few of posts about this but not yet a proper selfcontained test case. If one could be provided, I'd be interested in seeing if there's any problems in the Lua binding related to this, in that case a few more modification to the tolua generator might do it...

Think of it as a small pet project for me to perhaps contribute a little to CEGUI again now and then.

Also I'm interested in using Lua for a few projects where decent handling of UTF-8 is critical (even if it requires a small utf8 library), so I have my own egoistic reasons to spend time on this as well.

Posted: Wed Feb 25, 2009 13:58
by CrazyEddie
lindquist wrote:Think of it as a small pet project for me to perhaps contribute a little to CEGUI again now and then.


As always, all contributions will be gratefully received; especially yours ;)

CE.