[fpc-devel] XML and encoding problems

Bogusław Brandys brandys at o2.pl
Sun Apr 23 18:43:01 CEST 2006

Alexander Todorov wrote:
> Hello,
> I am developing an application in Lazarus that is multi platform. It
> has very strong usage of xml that contains contains cyrillic text
> (Bulgarian language). All xml feeds are UTF-8 encoding and is
> converted internaly using iconv (UTF-8 -> CP1251 and vice versa) when
> needed. On Linux this is working very well, but on Windows it is not.
> I have iconv.pas and link to iconv.dll but the problem is that when a
> xml document is read from file / stream after that the contents of the
> document are not UTF-8 encoded and iconv fails.
> Attached is a simple program that reads a file and prints xml values.
> On Linux the result is :
> alex at optical:~/temp/utf$ ./project1
> user=Тихомир Руменов Тотев
> This is correct. Tested with gnome-terminal on native Linux system and
> with Bitvise Tunelier ssh client for Windows.
> On Windows the result is :
> E:\TMP\utf>project1.exe
> user=????N???????N? ?аN????╡?????? ????N??╡??
> This is not correct. I tried debugging this but couldn't find the problem.
> Compiled with Lazarus 0.9.14 / FPC 2.0.2.
> Please give some help / hints / workaround. This is very cruical for me ATM.
> Thanks.
Result printed on console are not sufficient.Compare binary chunks, then 
later check for system locale support.


More information about the fpc-devel mailing list