Hi,

Sorry if this is not in the correct mailing list, but I thought, seeing that Lazarus can read .pas files or .lfm files that contain utf-8 text, you guys might know the answer.

What is the correct why of reading a text file that contains UTF-8 text?

I am using the ReadBlock() method, and for testing purposes a WriteBlock() method. When I check the results of the new file populated by WriteBlock() the text looks fine.

But if I use ReadBlock() and store the result in a String (AnsiString) and then writeln() the read data, the utf-8 text gets mangled. As shown below....

Any thoughts as to why?

===================
    Hint := '';
    Text := '�ALabel';
  end;
===================

Writeln() can handle the text as far as I can see, because if I assign that exact same text to a String variable and then writeln() that variable, the text looks fine in the console output.

I'm using Ubuntu 8.04, FPC 2.2.5 and Lazarus 0.9.27 (trunk).


Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to