[Lazarus] RTL functions and file system encoding issues

Florian Klaempfl florian at freepascal.org
Wed Mar 12 14:00:24 CET 2008

Graeme Geldenhuys schrieb:
> On 12/03/2008, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>>  Solution in fpGUI and MSEgui.  Create your own RTL functions dependent
>>  per platform.
>>  eg:
>>   fpgSetCurrentDirectory()
>>     Under Linux it uses UTF-8 so is a wrapper for RTL SetCurrentDirectory.
>>     Under Windows we have to convert UTF-8 to ANSI or WideString and
>>  call the appropriate Windows.SetCurrentDirectory[A,W] functions.
> It was just pointed out to me that not all Linux installations are
> UTF-8 either (some older systems etc). So more black magic has to
> happen for Linux's RTL wrapper functions as well.

Just include cwstrings and assign the file names you get from the rtl
functions to widestrings and you're fine. Alternativly you can apply
UTF8Encode onto the file name.

More information about the Lazarus mailing list