[Lazarus] OpenDialog, TFileStream and unicode file name

Krzysztof dibo20 at wp.pl
Thu Dec 20 09:24:20 CET 2012


Hi,

I have file "01 Amassakoul 'N'Ténéré.mp3" (don't know what language it
is)

This code work on linux:

  if OpenDialog1.Execute then
  begin
    ShowMessage(GuessEncoding(OpenDialog1.FileName));
    f := TFileStream.Create(OpenDialog1.FileName,fmOpenRead);
    try

    finally
      f.Free;
    end;
  end;

But on windows I get error "Unable to open file....". GuessEncoding return
"UTF8" so I tried to convert it by UTF8ToSys, UTF8ToCP1252 but same error.
I read http://wiki.freepascal.org/LCL_Unicode_Support but have no idea what
to do

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121220/6193ca91/attachment-0002.html>


More information about the Lazarus mailing list