Page 1 of 1

unicode problem

Posted: Thu Apr 26, 2007 19:52
by mako
maybe someone could help me with an issue with cegui editbox->getText();
I typed an accentuated word in the editbox like 'pé de sapé'.
when I try to pick the word

with the code
Code:

CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::String voc = wmgr.getWindow((CEGUI::utf8*)"editbox1");->getText();
const char* vocabulo = voc.c_str();


the accentuated letters becomes weird. and I can't get the word in its real form.
how can I set to "vocabulo" the word that I typed on the editbox?

pé de sapé becomes: pé de sapé

do someone knows what's going on?

Posted: Fri Apr 27, 2007 05:51
by Dalfy
The output of CEGUI::String::c_str() is encoded using UTF-8. Make sure the tool you use to visualize the output of your program understand utf-8 and that the tool understand that the file contains utf-8 sequence.

I hope it helps