Sample_Demo8:
code as follows:
local text = winMgr:getWindow("Demo8/Window1/Controls/Editbox"):getText()
winMgr:getWindow("Demo8/Window1/Controls/Editbox"):setText(text)
if the string text contains Chinese characters,then i call setText(text),now
you can't see the text of editbox,it has been confused,you just can view another symbol.
I use font simhei-12.font, you can set Chinese characters in c++ code,
for example setText((utf8*)"中"),the editbox can show right, but call
getText() then call setText() in lua,it fails.
Some questions about getText() and setText() in lua
Moderators: CEGUI MVP, CEGUI Team
Some questions about getText() and setText() in lua
Glad to meet all friends here,I think I can take happy to you all!
it's because of tolua++
tolua++ simply maps lua 'string' as CEGUI::String. and tolua++ deals strings as 'const char*'
when u call 'Window::getText',, CEGUI::String automatically decode utf32 string to utf8 and returns utf8 pointer, then 'Window::setText' gets it as 'const char*' so.. CEGUI::String do the encode to utf8 again,,
i got the same prob. in korean lua scripting,, and i got a temporal solution that casting NOT 'const char*' but 'utf8' (in lua_CEGUI.cpp)
so it works for me..
sorry for short english, good luck
when u call 'Window::getText',, CEGUI::String automatically decode utf32 string to utf8 and returns utf8 pointer, then 'Window::setText' gets it as 'const char*' so.. CEGUI::String do the encode to utf8 again,,
i got the same prob. in korean lua scripting,, and i got a temporal solution that casting NOT 'const char*' but 'utf8' (in lua_CEGUI.cpp)
so it works for me..
sorry for short english, good luck
to amugana
amugana sir:
thank you for your kind suggesting and detail decription,and also i will try to find another solution for this,no same way but same aim.
good luck to you.
john.
thank you for your kind suggesting and detail decription,and also i will try to find another solution for this,no same way but same aim.
good luck to you.
john.
Glad to meet all friends here,I think I can take happy to you all!
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 7 guests