Re: Always reports utf-8 encoding?

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