On Fri, Sep 20, 2019 at 8:56 PM Mattias Gaertner via lazarus
<[email protected]> wrote:

Old Windows version:

> > >> function FileExistsUTF8(const Filename: string): boolean;
> > >> var
> > >>    Attr: Longint;
> > >> begin
> > >>    Attr := FileGetAttrUTF8(FileName);
> > >>    if Attr <> -1 then
> > >>      Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0
> > >>    else
> > >>      Result:=False;
> > >> end;
> > >

> I added an incompatibility note:
> https://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes#LazUtils_Changes

I think that is incorrect.
As you can see above the old version also returned FALSE for
directories (it used the same logic as the Windows implementation of
FileExists).

The reason the implementation has changed is that since LCL is UTF8
the automatic conversion fpc does is now lossless, which it wasn't
before 3.0.

-- 
Bart
-- 
_______________________________________________
lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to