Re: Expat and JavaScript

Franky Braem <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Karl Waclawek wrote:
>
> I know nothing about the wx API, but it seems that maybe you are 
> calling the
> wxstring constructor with the wrong arguments. "name" is already in 
> UTF-16 encoding,
> so why pass an instance of wxMBConvUTF16 (Google indicates this is 
> used for converting
> from UTF-8 to UTF-16)?
>
Actually the passed encoding is not used, because wxJS uses wxWidgets in 
unicode. As stated in the wxWidgets manual:
*
-------------------------
wxString*(*const wchar_t**/ psz/, *wxMBConv 
<http://www.wxwindows.org/manuals/2.6.3/wx_wxmbconv.html#wxmbconv>&*/ 
conv/, *size_t*/ nLength = wxSTRING_MAXLEN/)

Initializes the string from first /nLength/ characters of wide string. 
The default value of wxSTRING_MAXLEN means take all the string. In ANSI 
build, /conv/'s WC2MB 
<http://www.wxwindows.org/manuals/2.6.3/wx_wxmbconv.html#wxmbconvwc2mb> 
method is called to convert /psz/ to wide string. It is ignored in 
Unicode build.
---------------------

The weird characters already shows up in the XML_Char argument of the 
StartElementHandler

Franky.
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.