h2pas: unicode file names

git-svn-id: trunk@46819 -
This commit is contained in:
mattias 2014-11-12 19:11:26 +00:00
parent f662240d36
commit 43888531e1
2 changed files with 20 additions and 24 deletions

View File

@ -24,7 +24,7 @@ interface
uses uses
Classes, SysUtils, LCLProc, LResources, LazConfigStorage, XMLPropStorage, Classes, SysUtils, LCLProc, LResources, LazConfigStorage, XMLPropStorage,
Forms, Controls, Dialogs, FileUtil, LazFileUtils, AVL_Tree, Forms, Controls, Dialogs, FileUtil, LazFileUtils, LazUTF8Classes, AVL_Tree,
// CodeTools // CodeTools
CodeAtom, CodeTree, KeywordFuncLists, NonPascalCodeTools, BasicCodeTools, CodeAtom, CodeTree, KeywordFuncLists, NonPascalCodeTools, BasicCodeTools,
FileProcs, CodeCache, SourceChanger, CodeToolManager, FileProcs, CodeCache, SourceChanger, CodeToolManager,
@ -621,7 +621,7 @@ type
TH2PasParser = class(TExtToolParser) TH2PasParser = class(TExtToolParser)
public public
class function DefaultSubTool: string; override; class function DefaultSubTool: string; override;
procedure ReadLine(Line: string; OutputIndex: integer; var Handled: boolean procedure ReadLine(Line: string; OutputIndex: integer; var {%H-}Handled: boolean
); override; // (worker thread) ); override; // (worker thread)
end; end;
@ -1023,9 +1023,9 @@ begin
FCIncludesValid:=true; FCIncludesValid:=true;
//DebugLn(['TH2PasFile.ReadCIncludes Filename="',Filename,'"']); //DebugLn(['TH2PasFile.ReadCIncludes Filename="',Filename,'"']);
try try
sl:=TStringList.Create; sl:=TStringListUTF8.Create;
try try
sl.LoadFromFile(UTF8ToSys(Filename)); sl.LoadFromFile(Filename);
for i:=0 to sl.Count-1 do begin for i:=0 to sl.Count-1 do begin
if not REMatches(sl[i],'^#include "(.+)"') then continue; if not REMatches(sl[i],'^#include "(.+)"') then continue;
SrcFilename:=Trim(REVar(1)); SrcFilename:=Trim(REVar(1));
@ -2236,7 +2236,7 @@ begin
DebugLn(['TH2PasConverter.MergeIncludeFiles merging file ' DebugLn(['TH2PasConverter.MergeIncludeFiles merging file '
,'"'+IncludeFile.Filename+'"'+' into "'+TextConverter.Filename+'"']); ,'"'+IncludeFile.Filename+'"'+' into "'+TextConverter.Filename+'"']);
try try
fs:=TFileStream.Create(UTF8ToSys(IncludeFile.Filename),fmOpenRead); fs:=TFileStreamUTF8.Create(IncludeFile.Filename,fmOpenRead);
try try
SetLength(s,fs.Size); SetLength(s,fs.Size);
if s<>'' then begin if s<>'' then begin

View File

@ -1,20 +1,20 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<Package Version="3"> <Package Version="4">
<Name Value="H2PasWizard"/> <Name Value="H2PasWizard"/>
<AddToProjectUsesSection Value="True"/>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="11"/>
<SearchPaths> <SearchPaths>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <Parsing>
<Generate Value="Faster"/> <SyntaxOptions>
</CodeGeneration> <UseAnsiStrings Value="False"/>
<Other> </SyntaxOptions>
<CompilerPath Value="$(CompPath)"/> </Parsing>
</Other>
</CompilerOptions> </CompilerOptions>
<Files Count="7"> <Files Count="6">
<Item1> <Item1>
<Filename Value="h2pasconvert.pas"/> <Filename Value="h2pasconvert.pas"/>
<UnitName Value="H2PasConvert"/> <UnitName Value="H2PasConvert"/>
@ -29,21 +29,17 @@
<Type Value="LFM"/> <Type Value="LFM"/>
</Item3> </Item3>
<Item4> <Item4>
<Filename Value="h2pasdlg.lrs"/>
<Type Value="LRS"/>
</Item4>
<Item5>
<Filename Value="h2passtrconsts.pas"/> <Filename Value="h2passtrconsts.pas"/>
<UnitName Value="H2PasStrConsts"/> <UnitName Value="H2PasStrConsts"/>
</Item5> </Item4>
<Item6> <Item5>
<Filename Value="idetextconvlistedit.pas"/> <Filename Value="idetextconvlistedit.pas"/>
<UnitName Value="IDETextConvListEdit"/> <UnitName Value="IDETextConvListEdit"/>
</Item6> </Item5>
<Item7> <Item6>
<Filename Value="idetextconvlistadd.pas"/> <Filename Value="idetextconvlistadd.pas"/>
<UnitName Value="IDETextConvListAdd"/> <UnitName Value="IDETextConvListAdd"/>
</Item7> </Item6>
</Files> </Files>
<i18n> <i18n>
<EnableI18N Value="True"/> <EnableI18N Value="True"/>