Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-11

Does FPC support XML encoding ?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexander Todorov

Hi all,
does fpc xml support encoding ???
I have a document with
<?xml version="1.0" encoding="UTF-8"?>

and an application which runs on a system with CP1251 locale. The text is read from the xml file but is not properly shown. How can I make it show properly ???
Delphi does this automatically ?

TIA

Reply by email

Sebastian Günther
to Alexander Todorov
Show quoted text 8 lines
Hi all, does fpc xml support encoding ??? I have a document with <?xml version="1.0" encoding="UTF-8"?> and an application which runs on a system with CP1251 locale. The text is read from the xml file but is not properly shown. How can I make it show properly ???

Actually the XML reader ignores the encoding. In FPC version 2.x it should be possible to cheat a little bit by modifying the AnsiString->Unicode translation manually. The XML reader processes input as 8 bit ASCII (AnsiStrings) and internally translates it to Unicode (i.e. WideStrings).

Yes the reader is old an incomplete. For the usual reason: No time... Will be improved, but the question is when.

- Sebastian

Reply by email