[Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread Xiangrong Fang
Hi, In order to write cross platform programs, shall I use ForceDirectories or ForceDirectoriesUTF8? I would like to: - Use native charset on the platform (i.e. UTF8 on Linux and whatever codepage on Windows) - Avoid using AnsiString or the like (as all my programs use string type, c

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread Sven Barth
On 02.03.2013 15:12, Xiangrong Fang wrote: * Avoid using AnsiString or the like (as all my programs use string type, change them all to AnsiString is scaring and I don't know the consequence at all). Are your programs compiled in either {$mode Delphi} or {$mode ObjFPC}{$H+}? If so th

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread Xiangrong Fang
My program is always in {$mode objfpc} So string is not a problem, but shall I use the UTF8 version or not? I remember that Windows is NOT UTF8? 2013/3/2 Sven Barth > On 02.03.2013 15:12, Xiangrong Fang wrote: > >> * Avoid using AnsiString or the like (as all my programs use string >> >>

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread leledumbo
s likely UTF-8 is at least in the subset. I suggest using UTF8 all the time. 1: You don't have to worry about it if in the future you need to support UTF-8 characters 2: It does not hurt your current program -- View this message in context: http://free-pascal-lazarus.989080.n3.nabbl

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread Bart
On 3/2/13, Xiangrong Fang wrote: > In order to write cross platform programs, shall I use ForceDirectories or > ForceDirectoriesUTF8? I would like to: I would think that that depends on where you get the value for ForceDirectories(UTF8) from. If this vale is obtained from any widget (OpenDialog

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-02 Thread Xiangrong Fang
> I would think that that depends on where you get the value for > ForceDirectories(UTF8) from. > If this vale is obtained from any widget (OpenDialog, TEdit, etc.) the > encoding of the value is in UTF-8. > If however you get the value as a commandline parameter, then it is in > system-encoding if

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-03 Thread Mattias Gaertner
On Sun, 3 Mar 2013 08:48:30 +0800 Xiangrong Fang wrote: > > I would think that that depends on where you get the value for > > ForceDirectories(UTF8) from. > > If this vale is obtained from any widget (OpenDialog, TEdit, etc.) the > > encoding of the value is in UTF-8. > > If however you get the

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-03 Thread Xiangrong Fang
> If your program has to work now or with older compilers/libraries you > have to use the *UTF8 functions. > > But the problem is, my program works on both Linux and Windows 7 using ForceDirectories (NOT the UTF8 version), and btw, I am running Chinese Version of Windows 7. Could you please tell m

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-03 Thread Mattias Gaertner
On Sun, 3 Mar 2013 16:42:33 +0800 Xiangrong Fang wrote: > > If your program has to work now or with older compilers/libraries you > > have to use the *UTF8 functions. > > > > But the problem is, my program works on both Linux and Windows 7 using > ForceDirectories (NOT the UTF8 version), and btw,

Re: [Lazarus] ForceDirectoriesUTF8

2013-03-03 Thread Jürgen Hestermann
I have had the same problem with all the different string encodings arround: Windows API-function can have ANSI or UTF16 encoding. FPC-RTL file functions are restricted to 255 characters (so only ANSI file names are possible). Linux seems to have UTF8. The LCL is UTF8 and the IDE can have differ