Re: [xml] encoding

On Tue, 2005-02-22 at 23:26 +0200, Bar Gam wrote:

Hi :)

If I try to parse a document encoded in iso-8859-8 - should it be
converted to UTF-8, or is it supported and handled by the parser on
the fly? If the content should be converted (and deconverted) - what
method should be used in this 

Providing the document encoding is correctly specified and providing you
have Iconv support compiled in, the conversion to UTF-8 will be done for
you automatically as libxml2 parses the document.

If the document encoding is not specified in the xml declaration at the
top of the file (<?xml encoding="..."?>), there is a way to pass it in
directly when using the libxml API -- this is needed because of the way
HTTP documents have their encoding specified, for example. But I cannot
remember the exact call off the top of my head.

You can see if you have Iconv support available by looking at the output
of 'xmllint --version'.


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