[Expat-discuss] UNICODE utf-16 and weird characters

gnschmidt at ukonline.co.uk gnschmidt at ukonline.co.uk
Thu Jun 29 13:22:17 CEST 2006


Franky

I think the problem is the wxString constructor, which defaults to wxConvLocal
for conversions. I know wxConvUTF8 is predefined, but I'm not sure if the same
is true of wxConvUTF16.

For the non-Unicode build, the following works without problems:

wxString xmlName = wxString(name, wxConvUTF8, strlen(name));

It should be possible to adapt this to use wxConvUTF16 instead (if wxConvUTF16
isn't predefined wxWidgets will let you create an instance).


Quoting Franky Braem <franky.braem at gmail.com>:

> I've build expat 2.0 with UNICODE. This uses internally UTF-16 and wchar_t.
> 
> When I use the parser, it sees all the tags, but the strings it reports 
> contain weird (Chinese) characters. This is an example code:
> 
> void ModulesXMLParser::StartElementHandler(void *userData,
>                                           const XML_Char *name,
>                                           const XML_Char **atts)
> {
>    wxString xmlName(name);
>    ...
> }
> 
> Why do I see those Chinese characters (although my xml file contains 
> simple characters)?
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
> 




----------------------------------------------
This mail sent through http://www.ukonline.net


More information about the Expat-discuss mailing list