w_char / unicode

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
kitt3n
Just popping in
Just popping in
Posts: 17
Joined: Wed Jan 12, 2005 12:06

w_char / unicode

Postby kitt3n » Wed Mar 09, 2005 21:19

Hi,

I've been looking through your string class and noticed the utf16 part is still commented out.
I understand it's on the todo-list, but in the meanwhile, since our lokalization-tools all work
with wstrings, I'm wondering on how to make the two systems compatible.

So, does the ceGui contain any functions to convert from wchar-strings to these utf8 strings -
or do I have to use an external function, sth like the qin32/WideCharToMultiByte (I
assume this function gives an utf8-encoded string)

And in the future - if utf16 is supported, am I correct that this conversion is then not
needed anymore but I can directly insert my wchar-strings into the gui?


Regards,
Roger

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: w_char / unicode

Postby CrazyEddie » Thu Mar 10, 2005 09:46

The problem with wchar_t and associated class specialisations is that wchar_t is not portable in the way that we need it to be.

Basically, if you use wchar_t exclusively as a "black box" then likely all will be fine, but if you need to peek inside that box then suddenly you're up the creek, because what wchar_t represents exactly is implementation specific; and therefore non-portable.

I'm not certain if the Win32 WideCharToMultiByte call returns UTF-8 data or not, if it does not explicitly state this in the MS documentation, then you can't assume it does. There's a few Unicode related parts of msdn which are less than clear on what exactly you are (or are not) getting, and as such Win32 is not as Unicode compliant as many would have you believe.

When UTF-16 is supported you will be able to pass in a UTF-16 encoded string. However, this does not mean wchar_t (for the above reasons), since it may work on some systems, but on others it would fail :?

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 8 guests