projtemplates: unicode file names

git-svn-id: trunk@46823 -
This commit is contained in:
mattias 2014-11-12 19:19:54 +00:00
parent d2b78b6f28
commit f9afbae84f

View File

@ -5,7 +5,7 @@ unit ProjectTemplates;
interface interface
uses uses
Classes, SysUtils, FileUtil, IniFiles; Classes, SysUtils, FileUtil, LazUTF8Classes, IniFiles;
type type
@ -296,12 +296,12 @@ end;
procedure TProjectTemplate.InitFromDir(const DirName: String); procedure TProjectTemplate.InitFromDir(const DirName: String);
Var Var
L : TStringList; L : TStringListUTF8;
FN : String; FN : String;
begin begin
FDirectory:=IncludeTrailingPathDelimiter(DirName); FDirectory:=IncludeTrailingPathDelimiter(DirName);
L:=TStringList.Create; L:=TStringListUTF8.Create;
Try Try
FN:=FDirectory+'project.ini'; FN:=FDirectory+'project.ini';
If FileExistsUTF8(FN) then If FileExistsUTF8(FN) then
@ -324,7 +324,7 @@ begin
FN:=Directory+'description.txt'; FN:=Directory+'description.txt';
If FileExistsUTF8(FN) then If FileExistsUTF8(FN) then
begin begin
L.LoadFromFile(UTF8ToSys(FN)); L.LoadFromFile(FN);
FDescription:=L.Text; FDescription:=L.Text;
end; end;
GetFileList(FDirectory); GetFileList(FDirectory);
@ -403,7 +403,7 @@ end;
procedure TProjectTemplate.CopyAndSubstituteFile(Const SrcFN,DestFN : String; Values : Tstrings); procedure TProjectTemplate.CopyAndSubstituteFile(Const SrcFN,DestFN : String; Values : Tstrings);
Var Var
L : TStrings; L : TStringListUTF8;
begin begin
If pos(ExtractFileExt(SrcFN)+',',Exclude)<>0 then If pos(ExtractFileExt(SrcFN)+',',Exclude)<>0 then
@ -413,10 +413,10 @@ begin
end end
else else
begin begin
L:=TstringList.Create; L:=TStringListUTF8.Create;
try try
CreateFile(SrcFN,L,Values); CreateFile(SrcFN,L,Values);
L.SaveToFile(UTF8ToSys(DestFN)); L.SaveToFile(DestFN);
Finally Finally
L.Free; L.Free;
end; end;