[Expat-discuss] Expat and JavaScript

Franky Braem franky.braem at gmail.com
Wed Aug 2 19:34:08 CEST 2006


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.



More information about the Expat-discuss mailing list