[fpc-pascal] FileIO in FPC 3.0

Andreas Dorn adornno1 at web.de
Fri Sep 25 09:49:42 CEST 2015


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/desktop/aa365247%28v=vs.85%29.aspx

So e.g. converting a Filename from the Windows-API to UTF-8 can be lossy.
Does the new FPC-FileApi work correctly if a Filename contains invalid UTF-16 sequences? 

Assigning a codepage to something that basically is just some raw sequence of bytes from an 
external source sounds dangerous to me.



More information about the fpc-pascal mailing list