Recent

Author Topic: TStringList.LoadFromFile error with folder with accentuated name  (Read 3080 times)

euMesmo

  • New Member
  • *
  • Posts: 12
Hi everybody, I'm using Lazarus 1.2.6 and W7.

This is my problem:

In my program I have this:

procedure TForm1.FormCreate(Sender: TObject);
var
  fichero: TStringList;
begin
  fichero:= TStringList.Create;
  try
    fichero.LoadFromFile(UTF8ToAnsi(ExtractFilePath(Application.ExeName)+'app.cfg'));
    Memo1.Lines.Assign(fichero);
  finally
    fichero.Free;
  end;
end;

"exe" file and "cfg" file are in the same folder.
If this folder not contains accentuated letter as"ó" it works fine.
If I change the folder name to "Aplicación", program gives message error to open file.

This code in linux works fine.

Can you help me?.

Thanks. Excuseme my poor english

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TStringList.LoadFromFile error with folder with accentuated name
« Reply #1 on: February 26, 2015, 11:55:20 am »
Does it work without 'UTF8ToAnsi'?
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

euMesmo

  • New Member
  • *
  • Posts: 12
Re: TStringList.LoadFromFile error with folder with accentuated name
« Reply #2 on: February 26, 2015, 12:37:43 pm »
Yes, it works, thank you very much

 

TinyPortal © 2005-2018