[fpc-pascal] ReadXMLFile in fcl-xml package

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Sep 18 11:10:33 CEST 2014


On Thu, 18 Sep 2014 09:43:21 +0200
LacaK <lacak at zoznam.sk> wrote:

> Hi,
> I use ReadXMLFile from fcl-xml package to read XML file in UTF-8 encoding.
> Then I parse Nodes and use TextContent property which is string in 
> system encoding ... but I need it in UTF-8 encoding.
> So I use again UTF8Encode(Node.TextContent).
> Is there any SIMPLE way how to say that ReadXMLFile should not perform 
> translation from UTF-8 to system encoding?
> (may be somehow with custom TDecoder or so ... or use Laz_ versions or ...?)

The Lazarus sources contain units to read/write XML using UTF8 strings.
The units are based on the fcl-xml units. The widestrings were replaced
with UTF8 Ansistrings. lazarus/components/lazutils/laz2_xml*.
The units work standalone. You don't need Lazarus for them.

Mattias



More information about the fpc-pascal mailing list