writing special characters in a ListboxTextItem

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

luisaguirre4984
Just popping in
Just popping in
Posts: 2
Joined: Thu Nov 04, 2010 15:47

writing special characters in a ListboxTextItem

Postby luisaguirre4984 » Thu Nov 04, 2010 16:05

Hello I have any problems, I need writing in listboxtextitem a special character as "Ñ" but debuging my code i looked at CEGUI::String do not show it into the variable as "Ñ" else it show as a symbol when I use a CEGUI::utf8. And if I use CEGUI::utf32 it do not decode my characters and inside the listboxtexitem appear strange symbols. What can I do for solve my problem??
Thanks you and greeting to all.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: writing special characters in a ListboxTextItem

Postby Kulik » Thu Nov 04, 2010 16:25

CEGUI::String uses utf32 internally. That means that all characters inside it are converted to utf32. To see it in your debugger as utf8 you have to call CEGUI::String::data() to get utf8 encoded data (the buffer is automatically allocated for you).

Make sure your source code is encoded in utf8! Otherwise the characters appended from it will likely be garbage.

luisaguirre4984
Just popping in
Just popping in
Posts: 2
Joined: Thu Nov 04, 2010 15:47

Re: writing special characters in a ListboxTextItem

Postby luisaguirre4984 » Thu Nov 04, 2010 19:37

Thank for your answer, in fact I was using String.data() and I cheked my code and it is in utf8. but I do not understand why my code source decode can influence in it. Beside I readed in CEGUI documentation that:
"The use of extended ASCII characters (with values >0x7f) would result in incorrect behaviour as the String will attempt to 'decode' the data, with unpredictable results."
It is in constructor CEGUI::String(const utf8 *utf8_str ) , at now is it affecting into the member class or only in the constructor conversion. I do not get show in screen any characters.
Greetings.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 33 guests