Re: UNICODE utf-16 and weird characters

[email protected]
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
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 <[email protected]>:

> 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
> [email protected]
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
> 




----------------------------------------------
This mail sent through http://www.ukonline.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.