Re: [xml] UTF8ToHtml Umlaut bug?



Steven Falken <btwotch googlemail com> writes:

this works as normal, buf if you replace "outlen = 100;" with "outlen
= 4;" it hangs at converting the umlaut
(means outlen is set to zero after UTF8ToHtml).

outlen is supposed to be the length of the output buffer, so you should
have outlen = sizeof(buf); The output is more than 4 bytes so if you
tell it the output buffer is only 4 bytes long of course it will fail.

Moreover, why isn't it converting '<' to '&lt;'?

It looks like htmlEncodeEntities does that.
http://xmlsoft.org/html/libxml-HTMLparser.html#htmlEncodeEntities

P.S.: is there a htmlwriter in libxml2? I've only seen a xmlwriter.

There are some functions that write html in the HTMLtree module:
http://xmlsoft.org/html/libxml-HTMLtree.html

Noam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]