Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Felipe Monteiro de Carvalho <[EMAIL PROTECTED]>: > > Nothing arived here. Can't you just say if it worked or not? Crap! See the email below, I removed the screenshot for now. Under Linux, I could see and query the directory and file, while my system as setup for English. Again, no idea

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Vincent Snijders <[EMAIL PROTECTED]>: > > Even if it doesn't contain Russian locale, you would be able to create such > files in the windows explorer to create such file, for example by copy / > pasting the file name while renaming it. > > Then let your fpGui program check for its existen

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gaertner
On Mon, 30 Jun 2008 09:04:21 +0200 "Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote: > 2008/6/30 Vincent Snijders <[EMAIL PROTECTED]>: > > > > Even if it doesn't contain Russian locale, you would be able to > > create such files in the windows explorer to create such file, for > > example by copy / p

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/29 Vincent Snijders <[EMAIL PROTECTED]>: > > 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 syste

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gaertner
On Mon, 30 Jun 2008 01:03:38 +0200 "Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote: > 2008/6/29 Vincent Snijders <[EMAIL PROTECTED]>: > > > > 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 Wind

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: >> 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? By setting the LANG environment variable. export LANG=ru.UTF-8 > > L

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: > > Can you test to create a chinese filename in the explorer. For example: > > 北方话.txt > > Then check if the file exists. This should work independent of the > locale. > With Utf8ToAnsi this can not work on 1-byte locales. OK, I'll copy and paste t

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Vincent Snijders
Graeme Geldenhuys schreef: 2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: 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? By setting the LANG environment variable. expor

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: > > Can you test to create a chinese filename in the explorer. For example: > > 北方话.txt I can't create that file in Windows Explorer. I'm using Windows 2000 in a VMWare session. I opened explorer. Then copied the filename above to the clipboard from

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Vincent Snijders <[EMAIL PROTECTED]>: > > But for filenames in fpgFileExists? Sorry, yes the previous code was for things like painting text. Here is the code for fpgFileExists // platform indepenent function fpgFileExists(const FileName: TfpgString): Boolean; begin Result := FileEx

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gärtner
Zitat von Graeme Geldenhuys <[EMAIL PROTECTED]>: > 2008/6/30 Vincent Snijders <[EMAIL PROTECTED]>: > > > > But for filenames in fpgFileExists? > > Sorry, yes the previous code was for things like painting text. > > > Here is the code for fpgFileExists > > // platform indepenent > function fpgFileE

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Mattias Gärtner <[EMAIL PROTECTED]>: > >> function fpgFromOSEncoding(aString: string): TfpgString; >> begin >> Result := AnsiToUtf8(aString); >> end; > > ok. > I wonder, what windows gives for characters not in the current code page. Umm, no idea really. >> No idea if this is enough

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Marco van de Voort
> 2008/6/30 Mattias G?rtner <[EMAIL PROTECTED]>: > > >> No idea if this is enough for all cases (I'm not a unicode guru), but > >> Vladimir (russian developer) reported that it works for him. > > > > Of course it works for him - MS keeps things going. As long as a user stays > > in > > his code p

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Vincent Snijders
Graeme Geldenhuys schreef: 2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: Can you test to create a chinese filename in the explorer. For example: 北方话.txt I can't create that file in Windows Explorer. I'm using Windows 2000 in a VMWare session. I opened explorer. Then copied the filename abov

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gärtner
Zitat von Graeme Geldenhuys <[EMAIL PROTECTED]>: > 2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: > >> 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? > > By setti

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gärtner
Zitat von Graeme Geldenhuys <[EMAIL PROTECTED]>: > 2008/6/30 Mattias Gaertner <[EMAIL PROTECTED]>: > > > > Can you test to create a chinese filename in the explorer. For example: > > > > ±±·½»°.txt > > I can't create that file in Windows Explorer. I'm using Windows 2000 > in a VMWare session. I op

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gärtner
Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > 2008/6/30 Mattias G?rtner <[EMAIL PROTECTED]>: > > > > >> No idea if this is enough for all cases (I'm not a unicode guru), but > > >> Vladimir (russian developer) reported that it works for him. > > > > > > Of course it works for him - MS keep

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Marco van de Voort
> Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > > > > > Makes me wonder how CodeGear is going to handle something like this. > > > Have they released more information on their Unicode support? > > > > They actually use unicode support, so NT only -W functions. > > Do you know what happen w

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Mattias Gärtner
Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > > > > > > > Makes me wonder how CodeGear is going to handle something like this. > > > > Have they released more information on their Unicode support? > > > > > > They actually use unicode s

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Marco van de Voort
> Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > > types? > > > > It will be released in August. > > If they are bold enough for this big incompatibility, then maybe we must be > braver too. What, also stop supporting anything but Windows? > > Both. (and afaik .NET already is), but they d

Re: [fpc-pascal] Unicode filenames

2008-06-30 Thread Michael Van Canneyt
On Mon, 30 Jun 2008, Marco van de Voort wrote: > > Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > > > types? > > > > > > It will be released in August. > > > > If they are bold enough for this big incompatibility, then maybe we must be > > braver too. > > What, also stop supporting anyt

[fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Felipe Monteiro de Carvalho
Hello, There is already another thread about that, but the thread got too long, and I would like to make a concrete proposal about unicode file routines. It looks simple to me, there are just 2 ways to go, either utf-8 or utf-16. Correct me if I am wrong, but I beliave that FPC developers prefer

[fpc-pascal] UTF8String

2008-06-30 Thread Mattias Gärtner
Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > Zitat von Marco van de Voort <[EMAIL PROTECTED]>: > > > > types? > > > > > > It will be released in August. > > > > If they are bold enough for this big incompatibility, then maybe we must be > > braver too. > > What, also stop supporting anyth

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Mattias Gärtner
Zitat von Felipe Monteiro de Carvalho <[EMAIL PROTECTED]>: > Hello, > > There is already another thread about that, but the thread got too > long, and I would like to make a concrete proposal about unicode file > routines. > > It looks simple to me, there are just 2 ways to go, either utf-8 or > u

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Marco van de Voort
> There is already another thread about that, but the thread got too > long, and I would like to make a concrete proposal about unicode file > routines. > > It looks simple to me, there are just 2 ways to go, either utf-8 or > utf-16. There are more possibilities: - native encoding (utf-8 on *ni

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Vincent Snijders
Marco van de Voort schreef: It looks simple to me, there are just 2 ways to go, either utf-8 or utf-16. There are more possibilities: - native encoding (utf-8 on *nix, utf-16 on windows) - have two types. How can one write portable code with these options? - an unified type (type contains

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Graeme Geldenhuys
2008/6/30 Felipe Monteiro de Carvalho <[EMAIL PROTECTED]>: > It looks simple to me, there are just 2 ways to go, either utf-8 or > utf-16. Correct me if I am wrong, but I beliave that FPC developers > prefer utf-16, so we can have a widestring version of every routine in > the RTL which involves fi

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Felipe Monteiro de Carvalho
On Mon, Jun 30, 2008 at 9:31 AM, Mattias Gärtner <[EMAIL PROTECTED]> wrote: > But what about all existing code? > For example the FCL? > How will TStringList.LoadFromFile be converted? TStringList.LoadFromFile(AFileName: widestring); overload The ansi version could call the wide version and just

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Felipe Monteiro de Carvalho
On Mon, Jun 30, 2008 at 9:55 AM, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote: > I thought UTF-8 was prefered. Hence the reason Lazarus followed the > UTF-8 route in LCL and Unicode support. UTF-8 is much better for the LCL because it just fits much better in out existing codebase. For the RTL we

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Marco van de Voort
> Marco van de Voort schreef: > >> It looks simple to me, there are just 2 ways to go, either utf-8 or > >> utf-16. > > > > There are more possibilities: > > - native encoding (utf-8 on *nix, utf-16 on windows) > > - have two types. > > How can one write portable code with these options? How ca

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Vincent Snijders
Marco van de Voort schreef: Marco van de Voort schreef: It looks simple to me, there are just 2 ways to go, either utf-8 or utf-16. There are more possibilities: - native encoding (utf-8 on *nix, utf-16 on windows) - have two types. How can one write portable code with these options? How ca

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Marco van de Voort
> Marco van de Voort schreef: > At the borders of my I convert all strings to the 'internal type' and > encoding and > use it like that. Kind of like we are doing nowadays to convert the > line-endings in > text files. I don't like this. This makes e.g. processing a database export on Unix unn

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Felipe Monteiro de Carvalho
On Mon, Jun 30, 2008 at 10:32 AM, Marco van de Voort <[EMAIL PROTECTED]> wrote: > It should be possible to work in the native encoding. One doesn't want to > wrap _every_ function in _every_ header with conversions procs. It is not possible to work with a ever changing encoding. MyLabel.Caption :

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Marco van de Voort
> On Mon, Jun 30, 2008 at 10:32 AM, Marco van de Voort <[EMAIL PROTECTED]> > wrote: > > It should be possible to work in the native encoding. One doesn't want to > > wrap _every_ function in _every_ header with conversions procs. > > It is not possible to work with a ever changing encoding. > >

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread John Coppens
On Mon, 30 Jun 2008 10:03:18 -0300 "Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 30, 2008 at 9:55 AM, Graeme Geldenhuys > <[EMAIL PROTECTED]> wrote: > > I thought UTF-8 was prefered. Hence the reason Lazarus followed the > > UTF-8 route in LCL and Unicode support. > > UTF

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Felipe Monteiro de Carvalho
On Mon, Jun 30, 2008 at 11:35 AM, Marco van de Voort <[EMAIL PROTECTED]> wrote: > I understand the simplicity of one encoding is appealing, but you have to > look at all aspects, and that is not just representation in the GUI. > > It will mean that _every_ string transactie to the outside will have

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Luca Olivetti
En/na John Coppens ha escrit: This may have been discussed before - but should the encoding not be dependent on the locale? What would happen if I write a FPC program, if the internal routines are, eg., UTF-16, and my locale is set to en_US.UTF8? Anyway, I have the impression that most of Linux

Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread Martin Schreiber
On Monday 30 June 2008 22.19:49 Luca Olivetti wrote: > En/na John Coppens ha escrit: > > This may have been discussed before - but should the encoding not be > > dependent on the locale? What would happen if I write a FPC program, > > if the internal routines are, eg., UTF-16, and my locale is set