[fpc-pascal] Unicode filenames

Vincent Snijders vsnijders at quicknet.nl
Sun Jun 29 19:34:01 CEST 2008


Graeme Geldenhuys schreef:
> 2008/6/29 Vincent Snijders <vsnijders at quicknet.nl>:
>> How does the RTL support using unicode filenames (e.g. file names that
>> cannot be represented by the ansi char set)?
>>
>> For example the FileExists function takes a string which is encoded in the
>> system char set. If the system char set is UTF8, like most linuxes and Mac
>> OS X, then there is no problem. But on windows using a western european
>> charset, I cannot check for existence of a file with cyrilic characters,
>> even though I can enter them in the windows explorer and create such files.
> 
> In fpGUI we use UTF-8 for everything. We have wrapper file access
> functions which replaces the RTL ones. The unit is called
> gfx_utils.pas
> 
> eg:
> Windows GDI:
> -------
> function fpgToOSEncoding(aString: TfpgString): string;
> begin
>   Result := Utf8ToAnsi(aString);
> end;

I see you are crippled in the same way as the LCL, because you only can 
handle ansi filenames correctly.

Vincent



More information about the fpc-pascal mailing list