[Lazarus] File functions in codetools FileProcs

Michael Van Canneyt michael at freepascal.org
Tue Jul 13 16:06:39 CEST 2010



On Tue, 13 Jul 2010, Juha Manninen wrote:

> Mattias Gaertner wrote:
>> Uses section?
>> Maybe you mean required package?
>
> Maybe. I have lazarus.lpi open and my mind is mixed up.
>
>
>> BTW, unit FileUtil is one of the base units of the LCL, without
>> widgetset dependencies. Using it in console applications is safe.
>
> Yes, after adding LCL dependency and NoGUI widgetset. Currently the converter
> does not add LCL dependency for console apps. I will make it optional later.
> Some developers considered NoGUI widgetset as a bad idea, as you remember.
>
>
>> But when converting a console application it is not clear if
>> UTF8 filenames is a good choice (IMO).
>
> Can you please explain. I don't know the details here. I thought file name
> conversion is an OS related issue, not GUI related.

It is GUI related. 
The lazarus GUI uses UTF-8, so when transferring a filename from a TFileNameEdit 
(or TOPenDialog) to a FileOpen() function, the conversion from UTF-8 to system 
encoding must be done.

Console applications will normally not use UTF-8 in the first place, they
will normally be using system encoding from the start, so it is a bad idea 
to insert conversion routines, since none is necessary to start with...

Michael.




More information about the Lazarus mailing list