mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-22 23:05:58 +02:00
LCL: ExtractShortPathNameUTF8 is available in all supported fpc versions
* convert result to UTF8, non-ascii chars seem to be allowed in some cases (issue #12449) git-svn-id: trunk@18575 -
This commit is contained in:
parent
80e3207944
commit
1b27aa17ef
@ -193,9 +193,7 @@ function FileAgeUTF8(const FileName: string): Longint;
|
|||||||
function DirectoryExistsUTF8(const Directory: string): Boolean;
|
function DirectoryExistsUTF8(const Directory: string): Boolean;
|
||||||
function ExpandFileNameUTF8(const FileName: string): string;
|
function ExpandFileNameUTF8(const FileName: string): string;
|
||||||
function ExpandUNCFileNameUTF8(const FileName: string): string;
|
function ExpandUNCFileNameUTF8(const FileName: string): string;
|
||||||
{$IFNDEF VER2_2_0}
|
|
||||||
function ExtractShortPathNameUTF8(Const FileName : String) : String;
|
function ExtractShortPathNameUTF8(Const FileName : String) : String;
|
||||||
{$ENDIF}
|
|
||||||
function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint;
|
function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint;
|
||||||
function FindNextUTF8(var Rslt: TSearchRec): Longint;
|
function FindNextUTF8(var Rslt: TSearchRec): Longint;
|
||||||
procedure FindCloseUTF8(var F: TSearchrec);
|
procedure FindCloseUTF8(var F: TSearchrec);
|
||||||
|
@ -149,15 +149,10 @@ begin
|
|||||||
Result:=SysToUTF8(SysUtils.ExpandUNCFileName(UTF8ToSys(Filename)));
|
Result:=SysToUTF8(SysUtils.ExpandUNCFileName(UTF8ToSys(Filename)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFNDEF VER2_2_0}
|
|
||||||
function ExtractShortPathNameUTF8(const FileName: String): String;
|
function ExtractShortPathNameUTF8(const FileName: String): String;
|
||||||
begin
|
begin
|
||||||
// no need to convert the result back to UTF8,
|
Result:=SysToUTF8(SysUtils.ExtractShortPathName(UTF8ToSys(FileName)));
|
||||||
// because a short path name by definition contains only
|
|
||||||
// ascii chars, and therefore is also UTF8 encoded
|
|
||||||
Result:=SysUtils.ExtractShortPathName(UTF8ToSys(FileName));
|
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec
|
function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec
|
||||||
): Longint;
|
): Longint;
|
||||||
|
Loading…
Reference in New Issue
Block a user