mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-30 00:21:35 +01:00
LazFileUtils: Fix FileExistsUTF8 on Windows when FileName contains uncode
characters outside current codepage. git-svn-id: trunk@41283 -
This commit is contained in:
parent
0a3ee817e7
commit
0986ec79fe
@ -1062,10 +1062,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FileExistsUTF8(const Filename: string): boolean;
|
|
||||||
begin
|
|
||||||
Result:=SysUtils.FileExists(UTF8ToSys(Filename));
|
|
||||||
end;
|
|
||||||
|
|
||||||
function FileAgeUTF8(const FileName: String): Longint;
|
function FileAgeUTF8(const FileName: String): Longint;
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -36,6 +36,11 @@ begin
|
|||||||
InvalidateFileStateCache(Filename);
|
InvalidateFileStateCache(Filename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FileExistsUTF8(const Filename: string): boolean;
|
||||||
|
begin
|
||||||
|
Result:=SysUtils.FileExists(UTF8ToSys(Filename));
|
||||||
|
end;
|
||||||
|
|
||||||
function ExpandFileNameUtf8(const FileName: string; {const} BaseDir: String = ''): String;
|
function ExpandFileNameUtf8(const FileName: string; {const} BaseDir: String = ''): String;
|
||||||
var
|
var
|
||||||
IsAbs: Boolean;
|
IsAbs: Boolean;
|
||||||
|
|||||||
@ -181,6 +181,17 @@ begin
|
|||||||
InvalidateFileStateCache(Filename);
|
InvalidateFileStateCache(Filename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
{******* ANSI functions *******}
|
{******* ANSI functions *******}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user