Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

Fpgui directory errors

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Santiago A.

Hello:

I don't know if this is the right place to ask about fpgui, but I don't know any other ;-)

I lurking fpgui, compiling examples etc. When I tried to run maximus (The lightweight IDE in examples) I got this exception:

Can't create directory "C:\Documents and Settings\Santi\Configuraci?n local\Datos de programa\maximus\"

The trace back is:
fpg_iniutils.pas line 89.
{ We used a non-Global config dir, so should be able to create the dir }

  if not fpgForceDirectories(lDir) then
    raise Exception.CreateFmt(rsErrFailedToCreateDir, [lDir]);
//fpg_utils.pas line 150
function fpgExtractFilePath(const FileName: TfpgString): TfpgString;
begin
  Result := ExtractFilePath(fpgToOSEncoding(Filename));
end;
//fpg_utils.inc line 8
function fpgToOSEncoding(aString: TfpgString): string;
begin
  Result := Utf8ToAnsi(aString);
end;

The problem is with the accent of "Configuraci?n". The treatment of directories supposes that any string is in utf8 and must be converted to the OS encoding, in this case to ansi. But in this case gets its value from GetAppConfigDir (in sysutils), that returns a string already in ansi encoding. The easier and dirty solution I thought was, before calling fpgExtractFilePath, apply fpgFromOSEncoding to the value returned by GetAppConfigDir.

But no way, the problem goes further and then I get a new error Can't create file "C:\Documents and Settings\Santi\Configuraci?n local\Datos de programa\maximus\maximus.ini".
I think that there is a little mess about when and where the encoding is.

Saludos Santi

Reply by email

Graeme Geldenhuys
to Santiago A.
Santiago A. wrote
I don't know if this is the right place to ask about fpgui, but I don't know any other ;-)

No, this is the Lazarus mailing.

fpGUI Toolkit support is via the fpGUI support newsgroups. You can use a NNTP News Client or the Web Interface.

See this URL for more details:

http://fpgui.sourceforge.net/support.shtml

I'll answer your question there.

Regards,
- Graeme -

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

Reply by email