item->getText() and unicode in a Listbox
Posted: Fri Sep 12, 2008 18:47
Hi,
I'm having some problems with unicode characters. I add items in a Listbox, and they seems to be correctly added. At least they are correctly rendered, but when I try to access the items via getText() method, the unicode characters are shown like "Iván" instead of "Iván".
I've tried to change my project settings for use unicode, but with no improvement.
I add the Items using this code:
And when I try to access an item...
const char* name is equal to "Iván" instead of "Iván".
Any ideas? TIA!
I'm having some problems with unicode characters. I add items in a Listbox, and they seems to be correctly added. At least they are correctly rendered, but when I try to access the items via getText() method, the unicode characters are shown like "Iván" instead of "Iván".
I've tried to change my project settings for use unicode, but with no improvement.
I add the Items using this code:
Code: Select all
Listbox* list = static_cast<Listbox*>(winMgr.getWindow("FolderSelector/Frame/FolderList"));
vector<String> files = disk->getFiles();
for (int n = 0; n < files.size(); n++)
{
CEGUI::ListboxTextItem* item = new ListboxTextItem(files[n]);
item->setSelectionBrushImage("Vanilla-Images", "GenericBrush");
list->addItem(item);
}
And when I try to access an item...
Code: Select all
if (buttonName == "FolderSelector/Frame/FolderList")
{
Listbox* list = static_cast<Listbox*>(winMgr.getWindow("FolderSelector/Frame/FolderList"));
ListboxTextItem* item = static_cast<ListboxTextItem*>(list->getFirstSelectedItem());
if (item == NULL)
return 0;
String text = item->getText();
const char* name = text.c_str(); // At this point name == "Iván" instead of "Iván"
}
const char* name is equal to "Iván" instead of "Iván".
Any ideas? TIA!