mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-25 19:01:28 +02:00
LazUtils: Fix TFileSearcher encoding when -dEnableUTF8RTL is not used. Issue #28406, patch from Michl.
git-svn-id: trunk@49888 -
This commit is contained in:
parent
5086ce6b4a
commit
5642758bf1
@ -541,6 +541,10 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function FindMatch(var f: TSearchRec) : Longint;
|
function FindMatch(var f: TSearchRec) : Longint;
|
||||||
|
{$IFnDEF EnableUTF8RTL}
|
||||||
|
var
|
||||||
|
Dummy: String;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{ Find file with correct attribute }
|
{ Find file with correct attribute }
|
||||||
While (F.FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do
|
While (F.FindData.dwFileAttributes and cardinal(F.ExcludeAttr))<>0 do
|
||||||
@ -559,7 +563,13 @@ begin
|
|||||||
in win32 it is the ansi structure with a utf-8 string
|
in win32 it is the ansi structure with a utf-8 string
|
||||||
in wince it is a wide structure }
|
in wince it is a wide structure }
|
||||||
{$ifdef FindData_W}
|
{$ifdef FindData_W}
|
||||||
|
{$IFDEF EnableUTF8RTL}
|
||||||
f.Name:=UTF8Encode(UnicodeString(F.FindData.cFileName));
|
f.Name:=UTF8Encode(UnicodeString(F.FindData.cFileName));
|
||||||
|
{$ELSE}
|
||||||
|
Dummy := '';
|
||||||
|
Insert(UTF8Encode(UnicodeString(F.FindData.cFileName)), Dummy, 1);
|
||||||
|
f.Name := Dummy;
|
||||||
|
{$ENDIF}
|
||||||
{$else}
|
{$else}
|
||||||
f.Name:=F.FindData.cFileName;
|
f.Name:=F.FindData.cFileName;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user