[fpc-pascal] Unicode filenames

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jun 30 09:52:22 CEST 2008


On Mon, 30 Jun 2008 01:03:38 +0200
"Graeme Geldenhuys" <graemeg.lists at gmail.com> wrote:

> 2008/6/29 Vincent Snijders <vsnijders at quicknet.nl>:
> >
> > If you create a file with a russian name on your hard disk, can you
> > use fpgFileExists to check for its existence?
> 
> I don't know how to change the Windows language to Russian, but I do
> under Linux. So I did the following. I changed my Linux systems locale
> for an application to Russian. I had Russian translations of fpGUI
> Toolkit so used those. I copied the rsCancel resourcestring value (in
> Russian) to a Edit component. Copied that to clipboard, used the File
> Open dialog to 'create directory' and pasted the Russian word for
> Cancel in their.  Now I had a Russian directory on the hard drive.  I
> quit the program, changed back to English locale. Loaded the program,
> and it displayed the Russian directory correctly.
> 
> PS:
>  Even Linux's terminal didn't display the russian directory correcty.
> A whole bunch of '?????????' instead. fpGUI worked fine! ;-)

How did you change to russian locale?

 
> See attached screenshot. Application using English locale
> (en_ZA.UTF-8) as can be seen by the grid headers and displaying a
> Russian directory name.

Under Linux you use Result := aString; - no conversion. Still UTF-8.

Linux is not the problem here. Windows is. You must use the W functions.

Mattias



More information about the fpc-pascal mailing list