[Expat-discuss] Always reports utf-8 encoding?

Karl Waclawek karl at waclawek.net
Sat Sep 30 18:31:10 CEST 2006


Franky Braem wrote:
> When I do the following in the characterhandler:
>
>    ModulesXMLParser *modxml = (ModulesXMLParser *) userData;
>    modxml->m_chars.AppendData((void *) s, len * 2);
>
> it works. Note the len * 2. Is this mentioned in the docs somewhere? 
> If not, please add it.
>
>
The len refers to the number of XML_Chars, not to the number of bytes.
With XML_UNICODE the size of  XML_Char is 2, therefore the math above.
I would use sizeof(XML_Char) instead of 2.

Karl

Karl


More information about the Expat-discuss mailing list