On 03.05.2017 9:07, Petr Kristan wrote:
Try:
     Writeln(UTF8ToSys('ÄäÖöÜüß'));

No, it doesn't help.

I debugged into the issue and found out that the exported file was in DOS-850 encoding (the same as the console lived in). Delphi changes the output encoding to "DefaultSystemCodePage" if Output is different from console. This code shows the same behavior as in Delphi:

---
program GermanTest;

{$codepage utf8}

uses
  Windows, SysUtils;

begin
  if GetFileType(TTextRec(Output).Handle) <> FILE_TYPE_CHAR then
    SetTextCodePage(Output, DefaultSystemCodePage);
  Writeln('ÄäÖöÜüß');
end.
---

I reported it in bug tracker: https://bugs.freepascal.org/view.php?id=31746

On 03.05.2017 8:56, Michael Thompson wrote:
When I open the attachment on my PC, I see the correct characters

Upps. My fault - I sent the wrong (= with correct characters :D) file.

Ondrej
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to