diff --git a/components/lazutils/fileutil.inc b/components/lazutils/fileutil.inc index 830a028273..76b8b0f509 100644 --- a/components/lazutils/fileutil.inc +++ b/components/lazutils/fileutil.inc @@ -70,7 +70,13 @@ begin end; {$ENDIF} -// For ExpandFileNameUTF8 and ExpandUNCFileNameUTF8 + +function ExpandFileNameUTF8(const FileName: string): string; +begin + Result := LazFileUtils.ExpandFileNameUtf8(Filename); +end; + +// ToDo: For ExpandUNCFileNameUTF8 // // Don't convert to and from Sys, because this RTL routines // simply work in simple string operations, without calling native @@ -79,10 +85,7 @@ end; // The Ansi conversion just ruins Unicode strings // // See bug http://bugs.freepascal.org/view.php?id=20229 -function ExpandFileNameUTF8(const FileName: string): string; -begin - Result:=SysUtils.ExpandFileName(Filename); -end; +// It needs fixing like we did for LazFileUtils.ExpandFileNameUtf8(Filename) on Windows function ExpandUNCFileNameUTF8(const FileName: string): string; begin diff --git a/components/lazutils/fileutil.pas b/components/lazutils/fileutil.pas index 8d860ae519..4427f6e604 100644 --- a/components/lazutils/fileutil.pas +++ b/components/lazutils/fileutil.pas @@ -25,7 +25,7 @@ unit FileUtil; interface uses - SysConst, Classes, SysUtils, Masks, LazUtilsStrConsts, lazutf8; + SysConst, Classes, SysUtils, Masks, LazUtilsStrConsts, lazutf8, LazFileUtils; {$if defined(Windows) or defined(darwin)} {$define CaseInsensitiveFilenames} @@ -216,7 +216,7 @@ function UTF8ToConsole(const s: string): string;// converts UTF8 string to conso function FileExistsUTF8(const Filename: string): boolean; function FileAgeUTF8(const FileName: string): Longint; function DirectoryExistsUTF8(const Directory: string): Boolean; -function ExpandFileNameUTF8(const FileName: string): string; +function ExpandFileNameUTF8(const FileName: string): string; inline; function ExpandUNCFileNameUTF8(const FileName: string): string; function ExtractShortPathNameUTF8(Const FileName : String) : String; function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint;