Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said: > Yes. I see invalid UTF-8 file names on Linux systems often (cannot be > converted to UTF-16). > > Are invalid UTF-16 file names under Windows really a practical > problem? > What program allows to create invalid UTF-16 file names? > With "invalid U

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Graeme Geldenhuys
On 2015-09-25 12:47, Marco van de Voort wrote: >> > (Now lets better not start about the encoding of Filenames on non-Windows >> > OS... :-)) > BSD/Linux afaik has the same problem. The filesystem is binary, not textual. > The textual aspect is only interpretation. Under FreeBSD and Solaris, when

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Mattias Gaertner
On Fri, 25 Sep 2015 13:47:22 +0200 (CEST) mar...@stack.nl (Marco van de Voort) wrote: >[...] > BSD/Linux afaik has the same problem. The filesystem is binary, not textual. > The textual aspect is only interpretation. Yes. I see invalid UTF-8 file names on Linux systems often (cannot be converted

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Marco van de Voort
In our previous episode, Andreas Dorn said: > Is it safe to pass the Filename to procedures from the RTL without risking > corruption? In theory no, but since mostly filenames will be passed to functions that have the same assumptions, I assume the only problem is if you put such a filename in a s

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Jonas Maebe
Andreas Dorn wrote on Fri, 25 Sep 2015: If I understand that correctly, it stores the filename in a string that has been tagged as valid UTF-16. There are no tags for valid, invalid or unchecked UTF-16. A unicodestring is basically a sequence of widechars. Some operations, such as convert

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Andreas Dorn
On Fri, 25 Sep 2015, Michael Van Canneyt wrote: > It uses UTF16 on windows, not a codepage aware string. > So if you use widestring for all your filename strings, there will be no > problem. No conversions will happen.   If I understand that correctly, it stores the filename in a string that has

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Martin Schreiber
On Friday 25 September 2015 10:26:44 Michael Van Canneyt wrote: > So if you use widestring for all your filename strings, there will be no For better performance probably UnicodeString not WideString. Martin ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Jonas Maebe
Andreas Dorn wrote on Fri, 25 Sep 2015: In the discussion about resourcestrings I read that the RTL now uses codepage-aware strings for FileIO. So I wonder what kind of codepages do you use for FileIO? On Windows: UTF-16. The Windows-documentation calls Filenames "opaque sequence of WCHAR

Re: [fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Michael Van Canneyt
On Fri, 25 Sep 2015, Andreas Dorn wrote: Hi there,   In the discussion about resourcestrings I read that the RTL now uses codepage-aware strings for FileIO. So I wonder what kind of codepages do you use for FileIO? It uses UTF16 on windows, not a codepage aware string. So if you use widest

[fpc-pascal] FileIO in FPC 3.0

2015-09-25 Thread Andreas Dorn
Hi there,   In the discussion about resourcestrings I read that the RTL now uses codepage-aware strings for FileIO. So I wonder what kind of codepages do you use for FileIO? The Windows-documentation calls Filenames "opaque sequence of WCHARs". https://msdn.microsoft.com/en-us/library/windows/des