using UTF-8 for file operations and environment variables

git-svn-id: trunk@16236 -
This commit is contained in:
mattias 2008-08-25 22:32:23 +00:00
parent 19bc247735
commit 69cfe88898
267 changed files with 13516 additions and 13494 deletions

View File

@ -9,11 +9,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Kein CGI-Abfrage-Handler gesetzt."
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr "Kein CGI-Datenmodul um CGI-Anfrage zu bearbeiten"
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Kein CGI-Abfrage-Handler gesetzt."

View File

@ -9,11 +9,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Tidak ada set pengendali permintaan CGI."
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr "Tidak ada modul data CGI untuk menangani permintaan CGI"
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Tidak ada set pengendali permintaan CGI."

View File

@ -10,11 +10,11 @@ msgstr ""
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: nenurodyta CGI užklausų tvarkyklė."
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr "Nėra CGI „DataModule“ kad būtų galima apdoroti CGI užklausą."
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: nenurodyta CGI užklausų tvarkyklė."

View File

@ -4,11 +4,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Nenhum manipulador de CGI request configurado."
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr "Nenhum datamodule de CGI para manipular o CGI request."
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Nenhum manipulador de CGI request configurado."

View File

@ -11,11 +11,11 @@ msgstr ""
"X-Poedit-Language: Polish\n"
"X-Poedit-Country: POLAND\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr ""
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr ""
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr ""

View File

@ -4,11 +4,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr ""
#: cgimodules:serrnorequesthandler
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr ""

View File

@ -9,11 +9,11 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: cgimodules:serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Не установлен обработчик запроса CGI."
#: cgimodules:serrnomainmodule
#: cgimodules.serrnomainmodule
msgid "No CGI datamodule to handle CGI request."
msgstr "Отсутствует модуль данных CGI для обработки запроса CGI."
#: cgimodules.serrnorequesthandler
msgid "%s: No CGI request handler set."
msgstr "%s: Не установлен обработчик запроса CGI."

View File

@ -101,7 +101,7 @@ Timer: TTimer;
begin
if (fChms <> nil) and fChms.IsAnOpenFile(AFile) then Exit;
DoCloseChm;
if not FileExists(AFile) or DirectoryExists(AFile) then
if not FileExistsUTF8(AFile) or DirectoryExistsUTF8(AFile) then
begin
Exit;
end;

View File

@ -85,7 +85,7 @@ begin
fClient.ServerID := NameForServer;
if not fClient.ServerRunning then begin
with TProcess.Create(nil) do begin
CommandLine := ServerExe + ' --ipcname ' + NameForServer;
CommandLine := UTF8ToSys(ServerExe + ' --ipcname ' + NameForServer);
Execute;
end;
// give the server some time to get started

View File

@ -213,28 +213,28 @@ var
begin
FillChar(IsHandled, 51, 0);
for X := 1 to ParamCount do begin
if LowerCase(ParamStr(X)) = '--ipcname' then begin
if LowerCase(ParamStrUTF8(X)) = '--ipcname' then begin
IsHandled[X] := True;
if X < ParamCount then begin
fServerName := ParamStr(X+1);
fServerName := ParamStrUTF8(X+1);
IsHandled[X+1] := True;
end;
end;
if LowerCase(ParamStr(X)) = '--context' then begin
if LowerCase(ParamStrUTF8(X)) = '--context' then begin
IsHandled[X] := True;
if (X < ParamCount) then
if TryStrToInt(ParamStr(X+1), fContext) then
if TryStrToInt(ParamStrUTF8(X+1), fContext) then
IsHandled[X+1] := True;
end;
end;
// Loop through a second time for the url
for X := 1 to ParamCount do
if not IsHandled[X] then begin
//DoOpenChm(ParamStr(X));
if Pos('://', ParamStr(X)) = 0 then
OpenURL('file://'+ParamStr(X), fContext)
//DoOpenChm(ParamStrUTF8(X));
if Pos('://', ParamStrUTF8(X)) = 0 then
OpenURL('file://'+ParamStrUTF8(X), fContext)
else
OpenURL(ParamStr(X), fContext);
OpenURL(ParamStrUTF8(X), fContext);
Break;
end;
//we reset the context because at this point the file has been loaded and the

View File

@ -1050,8 +1050,8 @@ AStream: TFileStream;
AChm: TChmReader;
AIndex: Integer;
begin
if not FileExists(AFileName) then exit;
AStream := TFileStream.Create(AFileName, fmOpenRead);
if not FileExistsUTF8(AFileName) then exit;
AStream := TFileStream.Create(UTF8ToSys(AFileName), fmOpenRead);
AChm := TChmReader.Create(AStream, True);
AIndex := AddObject(AFileName, AChm);
fLastChm := AChm;
@ -1074,7 +1074,7 @@ begin
end;
if not Result then begin
AFileName := ExtractFilePath(FileName[0])+AFileName;
if FileExists(AFileName) and (ExtractFileExt(AFileName) = '.chm') then OpenNewFile(AFileName);
if FileExistsUTF8(AFileName) and (ExtractFileExt(AFileName) = '.chm') then OpenNewFile(AFileName);
Result := True;
end;
end;

View File

@ -68,7 +68,7 @@ begin
fClient.ServerID := NameForServer;
if not fClient.ServerRunning then begin
with TProcess.Create(nil) do begin
CommandLine := ServerExe + ' --ipcname ' + NameForServer;
CommandLine := UTF8ToSys(ServerExe + ' --ipcname ' + NameForServer);
Execute;
end;
// give the server some time to get started

View File

@ -120,7 +120,7 @@ FileName: String;
Url: String;
begin
Result:=shrNone;
if not FileExists(fHelpEXE) then begin
if not FileExistsUTF8(fHelpEXE) then begin
ErrMsg := 'The program "' + fHelpEXE + '" doesn''t seem to exist!';
Exit(shrViewerNotFound);
end;

View File

@ -3967,7 +3967,7 @@ var
//DebugLn('SearchDirectory searching ...');
if not DirPathExists(ADirectory) then exit;
if SysUtils.FindFirst(ADirectory+FileMask,faAnyFile,FileInfo)=0 then begin
if FindFirstUTF8(ADirectory+FileMask,faAnyFile,FileInfo)=0 then begin
repeat
// check if special file
if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='')
@ -3977,9 +3977,9 @@ var
AddToTreeOfUnitFiles(TreeOfUnitFiles,ADirectory+FileInfo.Name,
KeepDoubles);
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
var

View File

@ -612,7 +612,7 @@ begin
and (fLastIncludeLinkFileChangeStep=fChangeStep)
and (fLastIncludeLinkFile=AFilename)
and FileExistsCached(AFilename)
and (FileAge(AFilename)=fLastIncludeLinkFileAge)
and (FileAgeUTF8(AFilename)=fLastIncludeLinkFileAge)
then begin
exit;
end;
@ -620,7 +620,7 @@ begin
try
Result:=SaveIncludeLinksToXML(XMLConfig,'');
fLastIncludeLinkFile:=AFilename;
fLastIncludeLinkFileAge:=FileAge(AFilename);
fLastIncludeLinkFileAge:=FileAgeUTF8(AFilename);
fLastIncludeLinkFileChangeStep:=fChangeStep;
fLastIncludeLinkFileValid:=true;
finally
@ -640,7 +640,7 @@ begin
try
Result:=LoadIncludeLinksFromXML(XMLConfig,'');
fLastIncludeLinkFile:=AFilename;
fLastIncludeLinkFileAge:=FileAge(AFilename);
fLastIncludeLinkFileAge:=FileAgeUTF8(AFilename);
fLastIncludeLinkFileChangeStep:=fChangeStep;
fLastIncludeLinkFileValid:=true;
finally
@ -825,7 +825,7 @@ begin
end;
if not IsVirtual then begin
if CompareFilenames(AFilename,Filename)=0 then begin
//DebugLn('****** [TCodeBuffer.LoadFromFile] ',Filename,' FileDateValid=',FileDateValid,' ',FFileDate,',',FileAge(Filename),',',FFileChangeStep,',',ChangeStep,', NeedsUpdate=',FileNeedsUpdate);
//DebugLn('****** [TCodeBuffer.LoadFromFile] ',Filename,' FileDateValid=',FileDateValid,' ',FFileDate,',',FileAgeUTF8(Filename),',',FFileChangeStep,',',ChangeStep,', NeedsUpdate=',FileNeedsUpdate);
if FileNeedsUpdate then begin
Result:=inherited LoadFromFile(AFilename);
if Result then MakeFileDateValid;
@ -936,7 +936,7 @@ procedure TCodeBuffer.MakeFileDateValid;
begin
FFileChangeStep:=ChangeStep;
FLoadDateValid:=true;
FLoadDate:=FileAge(Filename);
FLoadDate:=FileAgeUTF8(Filename);
end;
function TCodeBuffer.SourceIsText: boolean;
@ -955,7 +955,7 @@ end;
function TCodeBuffer.FileDateOnDisk: longint;
begin
Result:=FileAge(Filename);
Result:=FileAgeUTF8(Filename);
end;
function TCodeBuffer.FileNeedsUpdate: boolean;
@ -973,7 +973,7 @@ function TCodeBuffer.FileOnDiskNeedsUpdate: boolean;
begin
if LoadDateValid then
Result:=Modified or (FFileChangeStep<>ChangeStep)
or (not FileExists(Filename))
or (not FileExistsUTF8(Filename))
else
Result:=false;
end;

View File

@ -904,7 +904,7 @@ begin
try
// To not parse the FPC sources every time, the options are saved to a file.
DebugLn(['TCodeToolManager.SimpleInit Config=',ConfigFilename]);
if FileExists(ConfigFilename) then
if FileExistsUTF8(ConfigFilename) then
Options.LoadFromFile(ConfigFilename);
// use environment variables
Options.InitWithEnvironmentVariables;

View File

@ -255,18 +255,18 @@ procedure TCodeToolsOptions.InitWithEnvironmentVariables;
begin
if FPCPath='' then
FPCPath:=FindDefaultCompilerFilename;
if GetEnvironmentVariable('PP')<>'' then
FPCPath:=GetEnvironmentVariable('PP');
if GetEnvironmentVariable('FPCDIR')<>'' then
FPCSrcDir:=GetEnvironmentVariable('FPCDIR');
if GetEnvironmentVariable('LAZARUSDIR')<>'' then
LazarusSrcDir:=GetEnvironmentVariable('LAZARUSDIR');
if GetEnvironmentVariableUTF8('PP')<>'' then
FPCPath:=GetEnvironmentVariableUTF8('PP');
if GetEnvironmentVariableUTF8('FPCDIR')<>'' then
FPCSrcDir:=GetEnvironmentVariableUTF8('FPCDIR');
if GetEnvironmentVariableUTF8('LAZARUSDIR')<>'' then
LazarusSrcDir:=GetEnvironmentVariableUTF8('LAZARUSDIR');
end;
function TCodeToolsOptions.FindDefaultCompilerFilename: string;
begin
Result:=SearchFileInPath(GetDefaultCompilerFilename,'',
GetEnvironmentVariable('PATH'),':',ctsfcDefault);
GetEnvironmentVariableUTF8('PATH'),':',ctsfcDefault);
end;
procedure TCodeToolsOptions.UpdateUnitLinkListValid;

View File

@ -532,7 +532,7 @@ var
NameValue: String;
begin
MakefileFPC:=TStringList.Create;
MakefileFPC.LoadFromFile(Filename);
MakefileFPC.LoadFromFile(UTF8ToSys(Filename));
i:=0;
while i<MakefileFPC.Count do begin
Line:=MakefileFPC[i];
@ -2978,7 +2978,7 @@ begin
//DebugLn('TDefinePool.CreateFPCTemplate CmdLine="',CmdLine,'"');
TheProcess := TProcess.Create(nil);
TheProcess.CommandLine := CmdLine;
TheProcess.CommandLine := UTF8ToSys(CmdLine);
TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
TheProcess.ShowWindow := swoHide;
Step:='Running '+CmdLine;
@ -3022,7 +3022,7 @@ begin
CmdLine:=CmdLine+' -iTO';
TheProcess := TProcess.Create(nil);
TheProcess.CommandLine := CmdLine;
TheProcess.CommandLine := UTF8ToSys(CmdLine);
TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
TheProcess.ShowWindow := swoHide;
Step:='Running '+CmdLine;
@ -3072,7 +3072,7 @@ begin
if CompilerOptions<>'' then
CmdLine:=CmdLine+' '+CompilerOptions;
CmdLine:=CmdLine+' -iTP';
TheProcess.CommandLine := CmdLine;
TheProcess.CommandLine := UTF8ToSys(CmdLine);
TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
TheProcess.ShowWindow := swoHide;
Step:='Running '+CmdLine;
@ -3280,7 +3280,7 @@ var
// read Makefile.fpc to get some hints
MakeFileFPC:=ADirPath+'Makefile.fpc';
SubDirs:='';
if FileExists(MakeFileFPC) then begin
if FileExistsUTF8(MakeFileFPC) then begin
ParseMakefileFPC(MakeFileFPC,DefaultTargetOS,GlobalSubDirs,TargetSubDirs);
SubDirs:=GlobalSubDirs;
if TargetSubDirs<>'' then begin
@ -3295,7 +3295,7 @@ var
if System.Pos(AppendPathDelim(FPCSrcDir)+'rtl'+PathDelim,ADirPath)>0 then
inc(Priority);
// search sources .pp,.pas
if FindFirst(ADirPath+FileMask,faAnyFile,FileInfo)=0 then begin
if FindFirstUTF8(ADirPath+FileMask,faAnyFile,FileInfo)=0 then begin
repeat
AFilename:=FileInfo.Name;
if (AFilename='') or (AFilename='.') or (AFilename='..') then
@ -3446,9 +3446,9 @@ var
end;
end;
end;
until FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
begin
@ -3516,7 +3516,7 @@ var
DebugLn('FindStandardPPUSources Searching ',CurMask,' in ',ADirPath);
{$ENDIF}
// search all ppu files in this directory
if FindFirst(ADirPath+CurMask,faAnyFile,FileInfo)=0 then begin
if FindFirstUTF8(ADirPath+CurMask,faAnyFile,FileInfo)=0 then begin
repeat
UnitName:=lowercase(ExtractFileNameOnly(FileInfo.Name));
{$IFDEF VerboseFPCSrcScan}
@ -3524,9 +3524,9 @@ var
{$ENDIF}
AddFPCSourceLinkForUnit(UnitName);
if (UnitTree=nil) or (UnitTree.Count=0) then exit;
until FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
PathStart:=PathEnd;
end;

View File

@ -460,15 +460,15 @@ begin
FListing.TimeStamp:=Pool.TimeStamp;
if Directory='' then exit;// virtual directory
// Note: do not add a 'if not DirectoryExists then exit'. This will not
// work on automounted directories. You must use FindFirst.
// Note: do not add a 'if not DirectoryExistsUTF8 then exit'. This will not
// work on automounted directories. You must use FindFirstUTF8.
// read the directory
WorkingListing:=nil;
WorkingListingCapacity:=0;
WorkingListingCount:=0;
try
if SysUtils.FindFirst(Directory+FileMask,faAnyFile,FileInfo)=0 then begin
if FindFirstUTF8(Directory+FileMask,faAnyFile,FileInfo)=0 then begin
repeat
// check if special file
if (FileInfo.Name='.') or (FileInfo.Name='..') or (FileInfo.Name='')
@ -488,9 +488,9 @@ begin
end;
WorkingListing[WorkingListingCount]:=FileInfo.Name;
inc(WorkingListingCount);
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
if WorkingListingCount=0 then exit;

View File

@ -46,7 +46,7 @@ begin
Options:=TCodeToolsOptions.Create;
// To not parse the FPC sources every time, the options are saved to a file.
if FileExists(ConfigFilename) then
if FileExistsUTF8(ConfigFilename) then
Options.LoadFromFile(ConfigFilename);
// setup your paths
@ -56,7 +56,7 @@ begin
// optional: ProjectDir and TestPascalFile exists only to easily test some
// things.
Options.ProjectDir:=GetCurrentDir+'/scanexamples/';
Options.ProjectDir:=GetCurrentDirUTF8+'/scanexamples/';
Options.TestPascalFile:=Options.ProjectDir+'simpleunit1.pas';
// init the codetools

View File

@ -37,7 +37,7 @@ var
begin
// create a template for the current directory
// all child nodes of this templates are only valid for this directory.
Directory:=ExpandFileName(GetCurrentDir);
Directory:=ExpandFileName(GetCurrentDirUTF8);
DirectoryTemplate:=TDefineTemplate.Create('Current working directory',
'Example template for current working directory','',Directory,da_Directory);

View File

@ -310,6 +310,7 @@ procedure SetNeedRTLAnsi(NewValue: boolean);
function UTF8ToSys(const s: string): string;// as UTF8ToAnsi but more independent of widestringmanager
function SysToUTF8(const s: string): string;// as AnsiToUTF8 but more independent of widestringmanager
// file operations
function FileExistsUTF8(const Filename: string): boolean;
function FileAgeUTF8(const FileName: string): Longint;
function DirectoryExistsUTF8(const Directory: string): Boolean;
@ -329,6 +330,11 @@ function CreateDirUTF8(const NewDir: String): Boolean;
function RemoveDirUTF8(const Dir: String): Boolean;
function ForceDirectoriesUTF8(const Dir: string): Boolean;
// environment
function ParamStrUTF8(Param: Integer): string;
function GetEnvironmentStringUTF8(Index : Integer): String;
function GetEnvironmentVariableUTF8(const EnvVar: String): String;
implementation
// to get more detailed error messages consider the os
@ -426,22 +432,13 @@ function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec
begin
Result:=SysUtils.FindFirst(UTF8ToSys(Path),Attr,Rslt);
Rslt.Name:=SysToUTF8(Rslt.Name);
{$IFDEF Unix}
Rslt.PathOnly:=SysToUTF8(Rslt.PathOnly);
{$ENDIF}
end;
function FindNextUTF8(var Rslt: TSearchRec): Longint;
begin
Rslt.Name:=UTF8ToSys(Rslt.Name);
{$IFDEF Unix}
Rslt.PathOnly:=UTF8ToSys(Rslt.PathOnly);
{$ENDIF}
Result:=SysUtils.FindNext(Rslt);
Rslt.Name:=SysToUTF8(Rslt.Name);
{$IFDEF Unix}
Rslt.PathOnly:=SysToUTF8(Rslt.PathOnly);
{$ENDIF}
end;
procedure FindCloseUTF8(var F: TSearchrec);
@ -509,6 +506,21 @@ begin
Result:=SysUtils.ForceDirectories(UTF8ToSys(Dir));
end;
function ParamStrUTF8(Param: Integer): string;
begin
Result:=SysToUTF8(ObjPas.ParamStr(Param));
end;
function GetEnvironmentStringUTF8(Index: Integer): String;
begin
Result:=SysToUTF8(SysUtils.GetEnvironmentString(Index));
end;
function GetEnvironmentVariableUTF8(const EnvVar: String): String;
begin
Result:=SysToUTF8(SysUtils.GetEnvironmentVariable(UTF8ToSys(EnvVar)));
end;
{-------------------------------------------------------------------------------
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
-------------------------------------------------------------------------------}
@ -516,10 +528,10 @@ function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
var
fs: TFileStream;
begin
if FileExists(Filename) then begin
if FileExistsUTF8(Filename) then begin
try
InvalidateFileStateCache;
fs:=TFileStream.Create(Filename,fmOpenWrite);
fs:=TFileStream.Create(UTF8ToSys(Filename),fmOpenWrite);
fs.Size:=0;
fs.Free;
except
@ -542,11 +554,11 @@ begin
TempFilename:=GetTempFilename(AppendPathDelim(DirectoryName),'tstperm');
Result:=false;
try
fs:=TFileStream.Create(TempFilename,fmCreate);
fs:=TFileStream.Create(UTF8ToSys(TempFilename),fmCreate);
s:='WriteTest';
fs.Write(s[1],length(s));
fs.Free;
if not SysUtils.DeleteFile(TempFilename) then
if not DeleteFileUTF8(TempFilename) then
InvalidateFileStateCache;
Result:=true;
except
@ -565,7 +577,7 @@ begin
i:=1;
repeat
Result:=CurPath+CurName+IntToStr(i)+'.tmp';
if not FileExists(Result) then exit;
if not FileExistsUTF8(Result) then exit;
inc(i);
until false;
end;
@ -612,7 +624,7 @@ begin
CurFile:=copy(Result,StartPos,EndPos-StartPos);
AliasFile:='';
Ambiguous:=false;
if SysUtils.FindFirst(CurDir+FileMask,faAnyFile,FileInfo)=0 then
if FindFirstUTF8(CurDir+FileMask,faAnyFile,FileInfo)=0 then
begin
repeat
// check if special file
@ -636,10 +648,10 @@ begin
end;
end;
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end else
FileNotFound:=true;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
if FileNotFound then break;
if (AliasFile<>'') and (not Ambiguous) then begin
// better filename found -> replace
@ -719,7 +731,7 @@ var
{$ENDIF}
begin
{$IFDEF WINDOWS}
Result:=FileExists(AFilename);
Result:=FileExistsUTF8(AFilename);
{$ELSE}
// first check AFilename is not a directory and then check if executable
Result:= (FpStat(AFilename,info)<>-1) and FPS_ISREG(info.st_mode) and
@ -734,7 +746,7 @@ var AText: string;
begin
// TProcess does not report, if a program can not be executed
// to get good error messages consider the OS
if not FileExists(AFilename) then begin
if not FileExistsUTF8(AFilename) then begin
raise Exception.CreateFmt(ctsFileDoesNotExists,[AFilename]);
end;
{$IFNDEF MSWindows}
@ -806,7 +818,7 @@ end;
function DirPathExists(DirectoryName: string): boolean;
begin
Result:=Sysutils.DirectoryExists(ChompPathDelim(DirectoryName));
Result:=DirectoryExistsUTF8(ChompPathDelim(DirectoryName));
end;
function ForceDirectory(DirectoryName: string): boolean;
@ -820,7 +832,7 @@ begin
if DirectoryName[i]=PathDelim then begin
Dir:=copy(DirectoryName,1,i-1);
if not DirPathExists(Dir) then begin
Result:=CreateDir(Dir);
Result:=CreateDirUTF8(Dir);
if not Result then exit;
end;
end;
@ -841,7 +853,7 @@ end;
function FileIsWritable(const AFilename: string): boolean;
begin
{$IFDEF MSWindows}
Result:=((FileGetAttr(AFilename) and faReadOnly)=0);
Result:=((FileGetAttrUTF8(AFilename) and faReadOnly)=0);
{$ELSE}
Result:= BaseUnix.FpAccess(AFilename,BaseUnix.W_OK)=0;
{$ENDIF}
@ -856,7 +868,7 @@ var fs: TFileStream;
begin
Result:=false;
try
fs:=TFileStream.Create(AFilename,fmOpenRead);
fs:=TFileStream.Create(UTF8ToSys(AFilename),fmOpenRead);
try
// read the first 1024 bytes
Len:=1024;
@ -1299,7 +1311,7 @@ begin
UpperCaseUnitname:='';
end;
if SysUtils.FindFirst(Base+FileMask,faAnyFile,FileInfo)=0 then
if FindFirstUTF8(Base+FileMask,faAnyFile,FileInfo)=0 then
begin
repeat
// check if special file
@ -1339,9 +1351,9 @@ begin
else
RaiseNotImplemented;
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
if Result<>'' then Result:=Base+Result;
end;
@ -1403,7 +1415,7 @@ begin
UpperCaseFilename:='';
end;
if SysUtils.FindFirst(Base+FileMask,faAnyFile,FileInfo)=0 then
if FindFirstUTF8(Base+FileMask,faAnyFile,FileInfo)=0 then
begin
repeat
// check if special file
@ -1429,9 +1441,9 @@ begin
else
RaiseNotImplemented;
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
if Result<>'' then Result:=Base+Result;
end;
@ -1695,7 +1707,7 @@ begin
// search file
Result:='';
Base:=FindDiskFilename(Base);
if SysUtils.FindFirst(Base+FileMask,faAnyFile,FileInfo)=0 then
if FindFirstUTF8(Base+FileMask,faAnyFile,FileInfo)=0 then
begin
repeat
// check if special file
@ -1712,9 +1724,9 @@ begin
Result:=FileInfo.Name;
end;
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
if Result<>'' then Result:=Base+Result;
end;
else
@ -2674,7 +2686,7 @@ var
begin
Result := False;
if Check(Filename,fsciExists,AFile,Result) then exit;
Result:=FileExists(AFile.Filename);
Result:=FileExistsUTF8(AFile.Filename);
SetFlag(AFile,fsciExists,Result);
{if not Check(Filename,fsciExists,AFile,Result) then begin
WriteDebugReport;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@ interface
uses
{$IFDEF MEM_CHECK}MemCheck,{$ENDIF}
Classes, Laz_DOM, Laz_XMLRead, Laz_XMLWrite;
Classes, Laz_DOM, Laz_XMLRead, Laz_XMLWrite, FileProcs;
type
@ -441,7 +441,7 @@ begin
end;
doc:=nil;
if FileExists(AFilename) and (not fDoNotLoad) then
if FileExistsUTF8(AFilename) and (not fDoNotLoad) then
ReadXMLFile(doc,AFilename);
if not Assigned(doc) then

View File

@ -25,7 +25,7 @@ interface
uses
{$IFDEF MEM_CHECK}MemCheck,{$ENDIF}
SysUtils, Classes, Laz_DOM;
SysUtils, Classes, Laz_DOM, FileProcs;
type
@ -1414,7 +1414,7 @@ var
MemStream: TMemoryStream;
begin
ADoc := nil;
FileStream := TFileStream.Create(AFilename, fmOpenRead);
FileStream := TFileStream.Create(UTF8ToSys(AFilename), fmOpenRead);
if FileStream=nil then exit;
MemStream := TMemoryStream.Create;
try
@ -1485,7 +1485,7 @@ procedure ReadXMLFragment(AParentNode: TDOMNode; const AFilename: String);
var
Stream: TStream;
begin
Stream := TFileStream.Create(AFilename, fmOpenRead);
Stream := TFileStream.Create(UTF8ToSys(AFilename), fmOpenRead);
try
ReadXMLFragment(AParentNode, Stream, AFilename);
finally
@ -1556,7 +1556,7 @@ var
Stream: TStream;
begin
ADoc := nil;
Stream := TFileStream.Create(AFilename, fmOpenRead);
Stream := TFileStream.Create(UTF8ToSys(AFilename), fmOpenRead);
try
ReadDTDFile(ADoc, Stream, AFilename);
finally

View File

@ -22,7 +22,7 @@ unit Laz_XMLWrite;
interface
uses Classes, Laz_DOM;
uses Classes, Laz_DOM, FileProcs;
procedure WriteXMLFile(doc: TXMLDocument; const AFileName: String); overload;
procedure WriteXMLFile(doc: TXMLDocument; var AFile: Text); overload;
@ -482,7 +482,7 @@ begin
// write first to memory buffer and then as one whole block to file
WriteXMLMemStream(doc);
try
fs := TFileStream.Create(AFileName, fmCreate);
fs := TFileStream.Create(UTF8ToSys(AFileName), fmCreate);
fs.CopyFrom(Stream,Stream.Size);
fs.Free;
finally
@ -543,7 +543,7 @@ begin
SetWideStringManager(WideStringManager, OldWideStringManager);
try
{$ENDIF}
Stream := TFileStream.Create(AFileName, fmCreate);
Stream := TFileStream.Create(UTF8ToSys(AFileName), fmCreate);
wrt := @Stream_Write;
wrtln := @Stream_WriteLn;
InitWriter;

View File

@ -1271,7 +1271,7 @@ begin
{$I+}
useownfile:=true;
for i:=0 to Paramcount do
write(ownfile,paramstr(i),' ');
write(ownfile,ParamStr(i),' ');
writeln(ownfile);
end;

View File

@ -655,7 +655,7 @@ var
i: Integer;
begin
DebugLn(['TPPUGroups.AddFPCGroups ',FPCPPUBaseDir]);
if SysUtils.FindFirst(AppendPathDelim(FPCPPUBaseDir)+FileMask,faAnyFile,FileInfo)=0
if FindFirstUTF8(AppendPathDelim(FPCPPUBaseDir)+FileMask,faAnyFile,FileInfo)=0
then begin
repeat
// check if special file
@ -671,9 +671,9 @@ begin
if (not IsValidIdent(Groupname)) then continue;
AddFPCGroup(GroupName,AppendPathDelim(FPCPPUBaseDir)+FileInfo.Name);
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
procedure TPPUGroups.AddFPCGroup(const BaseGroupname, Directory: string);
@ -687,7 +687,7 @@ var
begin
//DebugLn(['TPPUGroups.AddFPCGroup ',Groupname,' ',Directory]);
Group:=nil;
if SysUtils.FindFirst(AppendPathDelim(Directory)+FileMask,faAnyFile,FileInfo)=0
if FindFirstUTF8(AppendPathDelim(Directory)+FileMask,faAnyFile,FileInfo)=0
then begin
repeat
// check if special file
@ -727,9 +727,9 @@ begin
Group:=AddGroup(GroupName);
Member:=Group.AddMember(UnitName);
Member.PPUFilename:=Filename;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
function TPPUGroups.FindGroupWithName(const AName: string): TPPUGroup;

View File

@ -1856,7 +1856,7 @@ var
ms: TMemoryStream;
fs: TFileStream;
begin
fs:=TFileStream.Create(Filename,fmOpenRead);
fs:=TFileStream.Create(UTF8ToSys(Filename),fmOpenRead);
ms:=TMemoryStream.Create;
try
ms.Size:=fs.Size;

View File

@ -662,7 +662,7 @@ var s: string;
begin
Result:=true;
try
fs:=TFileStream.Create(Filename, fmOpenRead);
fs:=TFileStream.Create(UTF8ToSys(Filename), fmOpenRead);
try
SetLength(s,fs.Size);
if s<>'' then
@ -700,7 +700,7 @@ begin
InvalidateFileStateCache;
// keep filename case on disk
TheFilename:=FindDiskFilename(Filename);
fs:=TFileStream.Create(TheFilename, fmCreate);
fs:=TFileStream.Create(UTF8ToSys(TheFilename), fmCreate);
try
s:=Source;
EncodeSaving(Filename,s);

View File

@ -823,7 +823,7 @@ function TStandardCodeTool.FixUsedUnitCaseInUsesSection(
end;
CurFilename:=ExtractFilename(AFilename);
Result:='';
if SysUtils.FindFirst(AppendPathDelim(CurDir)+FileMask,
if FindFirstUTF8(AppendPathDelim(CurDir)+FileMask,
faAnyFile,FileInfo)=0 then
begin
repeat
@ -836,9 +836,9 @@ function TStandardCodeTool.FixUsedUnitCaseInUsesSection(
if (Result='') or (FileInfo.Name=CurFilename) then
Result:=FileInfo.Name;
end;
until SysUtils.FindNext(FileInfo)<>0;
until FindNextUTF8(FileInfo)<>0;
end;
SysUtils.FindClose(FileInfo);
FindCloseUTF8(FileInfo);
end;
var

View File

@ -168,7 +168,7 @@ begin
try
FGenerator.GenerateCode(L);
If (FFileName<>'') then
L.SaveToFile(FFileName);
L.SaveToFile(UTF8ToSys(FFileName));
If ShowResult then
ShowCode(L);
finally

View File

@ -64,9 +64,9 @@ end;
procedure TConfigIDEDataDictForm.CheckData;
begin
If (FEDD.FileName='') or not (FileExists(FEDD.FileName)) then
If (FEDD.FileName='') or not (FileExistsUTF8(FEDD.FileName)) then
Raise Exception.Create(SErrSelectExe);
If (DEDD.Text='') or not (DirectoryExists(DEDD.Text)) then
If (DEDD.Text='') or not (DirectoryExistsUTF8(DEDD.Text)) then
Raise Exception.Create(SErrSelectDir)
end;

View File

@ -84,7 +84,7 @@ begin
end
else
begin
If (FEDD.FileName='') or not (FileExists(FEDD.FileName)) then
If (FEDD.FileName='') or not (FileExistsUTF8(FEDD.FileName)) then
Raise Exception.Create(SErrSelectFile)
end;
end;

View File

@ -50,7 +50,7 @@ begin
If (UnitName<>'') then
SDCode.FileName:=UnitName+'.pp';
If Execute then
MCode.Lines.SaveToFile(FileName);
MCode.Lines.SaveToFile(UTF8ToSys(FileName));
end;
end;

View File

@ -162,7 +162,7 @@ begin
FDictName:=AName;
FFileName:=AFileName;
If Active then
FDataDict.LoadFromFile(FFileName);
FDataDict.LoadFromFile(UTF8ToSys(FFileName));
end;
procedure TIDEDataDictionary.SetActive(const AValue: Boolean);
@ -282,7 +282,7 @@ begin
IDEMessagesWindow.BeginBlock(False);
Try
IDEMessagesWindow.AddMsg(SLoadingDataDict+SFromfile+FFileName,'',2);
FDataDict.LoadFromFile(FFileName);
FDataDict.LoadFromFile(UTF8ToSys(FFileName));
Finally
IDEMessagesWindow.EndBlock;
end;

View File

@ -102,9 +102,9 @@ Function TIDEDataDictCommandHandler.GetDataDesktopBinary : String;
begin
Result:=DataDesktopBinary;
If (Result='') or not FileExists(Result) then
If (Result='') or not FileExistsUTF8(Result) then
begin
Result:=FileSearch(LazDataDesktop,GetEnvironmentVariable('PATH'));
Result:=FileSearchUTF8(LazDataDesktop,GetEnvironmentVariableUTF8('PATH'));
If (Result='') then
if MessageDLG(SErrNoDataDesktopDoSelect,mtInformation,[mbYes,mbNo],0)=mrYes then
begin
@ -153,7 +153,7 @@ begin
FN:=FN+' -f "'+AFileName+'"';
With TProcess.Create(Nil) do
try
CommandLine:=FN;
CommandLine:=UTF8ToSys(FN);
Execute;
Finally
Free;

View File

@ -124,10 +124,10 @@ begin
Randomize;
FN:=TStringList.Create;
Try
FN.LoadFromFile(FFirstNamesFile);
FN.LoadFromFile(UTF8ToSys(FFirstNamesFile));
LN:=TStringList.Create;
Try
LN.LoadFromFile(FLastNamesFile);
LN.LoadFromFile(UTF8ToSys(FLastNamesFile));
Assign(F,FOutputFile);
Rewrite(F);
Try

View File

@ -215,7 +215,7 @@ begin
WriteCustomHelp;
writeln;
writeln('The results can be redirected to an xml file,');
writeln('for example: ', ParamStr(0),' --all > results.xml');
writeln('for example: ', ParamStrUTF8(0),' --all > results.xml');
end;
//get the format parameter

View File

@ -246,7 +246,7 @@ end;
procedure TGUITestRunner.GUITestRunnerShow(Sender: TObject);
begin
if (ParamStr(1) = '--now') or (ParamStr(1) = '-n') then
if (ParamStrUTF8(1) = '--now') or (ParamStrUTF8(1) = '-n') then
RunExecute(Self);
end;
@ -259,7 +259,7 @@ end;
procedure TGUITestRunner.SaveAsToolButtonClick(Sender: TObject);
begin
if SaveDialog.Execute then
XMLSynEdit.Lines.SaveToFile(SaveDialog.FileName);
XMLSynEdit.Lines.SaveToFile(UTF8ToSys(SaveDialog.FileName));
end;
procedure TGUITestRunner.TestTreeMouseDown(Sender: TOBject;

View File

@ -226,8 +226,8 @@ begin
For I:=0 to FRequest.Files.Count-1 do
begin
FN:=FRequest.Files[I].LocalFileName;
If FileExists(FN) then
DeleteFile(FN);
If FileExistsUTF8(FN) then
DeleteFileUTF8(FN);
end;
end;
@ -265,7 +265,7 @@ Var
begin
List.Clear;
For I:=1 to cgiVarCount do
List.Add(CGIVarNames[i]+'='+GetEnvironmentVariable(CGIVarNames[i]));
List.Add(CGIVarNames[i]+'='+GetEnvironmentVariableUTF8(CGIVarNames[i]));
end;
@ -345,7 +345,7 @@ var
R : String;
begin
R:=GetEnvironmentVariable('REQUEST_METHOD');
R:=GetEnvironmentVariableUTF8('REQUEST_METHOD');
if (R='') then
Raise Exception.Create(SErrNoRequestMethod);
FRequest.InitFromEnvironment;
@ -403,7 +403,7 @@ begin
I.Free;
end;
M.Position:=0;
With TFileStream.Create('/tmp/query',fmCreate) do
With TFileStream.Create(UTF8ToSys('/tmp/query'),fmCreate) do
try
CopyFrom(M,0);
M.Position:=0;
@ -439,7 +439,7 @@ begin
{$ifdef CGIDEBUG}
SendMethodEnter('InitGetVars');
{$endif}
FQueryString:=GetEnvironmentVariable('QUERY_STRING');
FQueryString:=GetEnvironmentVariableUTF8('QUERY_STRING');
If (FQueryString<>'') then
ProcessQueryString(FQueryString);
{$ifdef CGIDEBUG}
@ -516,13 +516,13 @@ end;
function TCGIRequest.GetCGIVar(Index: integer): String;
begin
Case Index of
1 : Result:=GetEnvironmentVariable(CGIVarNames[4]); // Property GatewayInterface : String Index 1 Read GetCGIVar;
2 : Result:=GetEnvironmentVariable(CGIVarNames[10]); // Property RemoteIdent : String Index 2 read GetCGIVar;
3 : Result:=GetEnvironmentVariable(CGIVarNames[11]); // Property RemoteUser : String Index 3 read GetCGIVar;
4 : Result:=GetEnvironmentVariable(CGIVarNames[12]); // Property RequestMethod : String Index 4 read GetCGIVar;
5 : Result:=GetEnvironmentVariable(CGIVarNames[14]); // Property ServerName : String Index 5 read GetCGIVar;
6 : Result:=GetEnvironmentVariable(CGIVarNames[16]); // Property ServerProtocol : String Index 6 read GetCGIVar;
7 : Result:=GetEnvironmentVariable(CGIVarNames[17]); // Property ServerSoftware : String Index 7 read GetCGIVar;
1 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[4]); // Property GatewayInterface : String Index 1 Read GetCGIVar;
2 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[10]); // Property RemoteIdent : String Index 2 read GetCGIVar;
3 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[11]); // Property RemoteUser : String Index 3 read GetCGIVar;
4 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[12]); // Property RequestMethod : String Index 4 read GetCGIVar;
5 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[14]); // Property ServerName : String Index 5 read GetCGIVar;
6 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[16]); // Property ServerProtocol : String Index 6 read GetCGIVar;
7 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[17]); // Property ServerSoftware : String Index 7 read GetCGIVar;
end;
end;
@ -541,7 +541,7 @@ begin
if (N<>'') then
begin
OV:=GetFieldByName(N);
V:=GetEnvironmentVariable(CGIVarNames[I]);
V:=GetEnvironmentVariableUTF8(CGIVarNames[I]);
If (OV='') or (V<>'') then
SetFieldByName(N,V);
end;
@ -552,12 +552,12 @@ end;
Function TCGIRequest.GetFieldValue(Index : Integer) : String;
begin
Case Index of
25 : Result:=GetEnvironmentVariable(CGIVarNames[5]); // Property PathInfo
26 : Result:=GetEnvironmentVariable(CGIVarNames[6]); // Property PathTranslated
27 : Result:=GetEnvironmentVariable(CGIVarNames[8]); // Property RemoteAddress
28 : Result:=GetEnvironmentVariable(CGIVarNames[9]); // Property RemoteHost
29 : Result:=GetEnvironmentVariable(CGIVarNames[13]); // Property ScriptName
30 : Result:=GetEnvironmentVariable(CGIVarNames[15]); // Property ServerPort
25 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[5]); // Property PathInfo
26 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[6]); // Property PathTranslated
27 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[8]); // Property RemoteAddress
28 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[9]); // Property RemoteHost
29 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[13]); // Property ScriptName
30 : Result:=GetEnvironmentVariableUTF8(CGIVarNames[15]); // Property ServerPort
else
Result:=Inherited GetFieldValue(Index);
end;

View File

@ -130,10 +130,10 @@ begin
// Make sure it is a PNG file.
FN:=ChangeFileExt(FN,'.png');
FN:=IncludeTrailingPathDelimiter(ImageDir)+FN;
If Not FileExists(FN) then
If Not FileExistsUTF8(FN) then
Raise Exception.Create('The requested file "'+OFN+'" does not exist in the image directory');
AResponse.ContentType:='image/png';
F:=TFileStream.Create(FN,fmOpenRead);
F:=TFileStream.Create(UTF8ToSys(FN),fmOpenRead);
Try
AResponse.ContentStream:=F;
AResponse.SendContent;

View File

@ -968,13 +968,13 @@ begin
Result:=mrCancel;
if not FileExistsCached(Filename) then exit;
ClearCIncludes;
FCIncludesFileAge:=FileAge(Filename);
FCIncludesFileAge:=FileAgeUTF8(Filename);
FCIncludesValid:=true;
//DebugLn(['TH2PasFile.ReadCIncludes Filename="',Filename,'"']);
try
sl:=TStringList.Create;
try
sl.LoadFromFile(Filename);
sl.LoadFromFile(UTF8ToSys(Filename));
for i:=0 to sl.Count-1 do begin
if not REMatches(sl[i],'^#include "(.+)"') then continue;
SrcFilename:=Trim(REVar(1));
@ -1006,7 +1006,7 @@ begin
FCIncludesValid:=false;
if Project=nil then exit;
if (not FileExistsCached(Filename)) then exit;
if FileAge(Filename)>FCIncludesFileAge then exit;
if FileAgeUTF8(Filename)>FCIncludesFileAge then exit;
FCIncludesValid:=true;
Result:=true;
end;
@ -1532,7 +1532,7 @@ begin
if List=nil then exit;
for i:=0 to List.Count-1 do begin
NewFilename:=CleanAndExpandFilename(List[i]);
if (NewFilename='') or (not FileExists(NewFilename)) then exit;
if (NewFilename='') or (not FileExistsUTF8(NewFilename)) then exit;
if CHeaderFileWithFilename(NewFilename)<>nil then exit;
NewFile:=TH2PasFile.Create;
NewFile.Project:=Self;
@ -1929,7 +1929,7 @@ var
procedure CloseOrRevertEditorFile(const Filename: string);
begin
if FileExists(Filename) then
if FileExistsUTF8(Filename) then
LazarusIDE.DoRevertEditorFile(Filename)
else
LazarusIDE.DoCloseEditorFile(Filename,[cfQuiet]);
@ -2063,8 +2063,8 @@ begin
TextConverter.Filename:=OutputFilename;// save
// clean up
if FileExists(TempCHeaderFilename) then
DeleteFile(TempCHeaderFilename);
if FileExistsUTF8(TempCHeaderFilename) then
DeleteFileUTF8(TempCHeaderFilename);
finally
TextConverter.Free;
if (LazarusIDE<>nil) then begin
@ -2213,7 +2213,7 @@ begin
DebugLn(['TH2PasConverter.MergeIncludeFiles merging file '
,'"'+IncludeFile.Filename+'"'+' into "'+TextConverter.Filename+'"']);
try
fs:=TFileStream.Create(IncludeFile.Filename,fmOpenRead);
fs:=TFileStream.Create(UTF8ToSys(IncludeFile.Filename),fmOpenRead);
try
SetLength(s,fs.Size);
if s<>'' then begin

View File

@ -321,7 +321,7 @@ begin
// create project
if Converter.AutoOpenLastProject
and FileExists(Converter.CurrentProjectFilename) then
and FileExistsUTF8(Converter.CurrentProjectFilename) then
OpenProject(Converter.CurrentProjectFilename,[]);
if Project=nil then begin
Converter.Project:=TH2PasProject.Create;
@ -1234,7 +1234,7 @@ begin
if ExtractFileExt(NewFilename)='' then
NewFilename:=NewFilename+'.h2p';
// warn if overwriting
if FileExists(NewFilename) then begin
if FileExistsUTF8(NewFilename) then begin
if QuestionDlg('Replace file?',
'The file "'+NewFilename+'"'#13
+'already exists.',
@ -1269,7 +1269,7 @@ var
begin
Result:=mrCancel;
NewFilename:=ExpandFileName(TrimFilename(Filename));
if not FileExists(NewFilename) then begin
if not FileExistsUTF8(NewFilename) then begin
if ofOnlyIfExists in Flags then begin
MessageDlg('File not found',
'File not found: "'+NewFilename+'"',mtError,[mbCancel],0);
@ -1281,7 +1281,7 @@ begin
if Project=nil then
Converter.Project:=TH2PasProject.Create;
if FileExists(NewFilename) then begin
if FileExistsUTF8(NewFilename) then begin
// load
try
Converter.LoadProject(NewFilename);

View File

@ -167,7 +167,7 @@ end;
procedure TfrmMain.accExportToTextExecute(Sender: TObject);
begin
TheReport.LoadFromFile(ExtractFilePath(ParamStr(0))+'salida.lrf');
TheReport.LoadFromFile(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf');
if TheReport.PrepareReport then
ShowMessage(cerNotImplemented)
//TheReport.ExportTo(TfrTextExportFilter, 'salida.txt')
@ -177,7 +177,7 @@ end;
procedure TfrmMain.accExportToHtmlExecute(Sender: TObject);
begin
TheReport.LoadFromFile(ExtractFilePath(ParamStr(0))+'salida.lrf');
TheReport.LoadFromFile(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf');
if TheReport.PrepareReport then begin
TheReport.ExportTo(TfrHTMExportFilter, 'salida.html');
ShowMessage(cerNotImplemented);
@ -187,7 +187,7 @@ end;
procedure TfrmMain.accExportToCSVExecute(Sender: TObject);
begin
TheReport.LoadFromFile(ExtractFilePath(ParamStr(0))+'salida.lrf');
TheReport.LoadFromFile(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf');
if TheReport.PrepareReport then begin
TheReport.ExportTo(TfrCSVExportFilter, 'salida.csv');
end else
@ -283,8 +283,8 @@ begin
comboIndex.Items.Add(Dbf1.Indexes[i].Name);
SetIndex('');
if fileexists(ExtractFilePath(ParamStr(0))+'salida.lrf') then
OpenReport(ExtractFilePath(ParamStr(0))+'salida.lrf');
if FileExistsUTF8(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf') then
OpenReport(ExtractFilePath(ParamStrUTF8(0))+'salida.lrf');
end;
procedure TfrmMain.SetIndex(const aIndexName: string);

View File

@ -29,7 +29,7 @@ implementation
procedure TForm2.FormShow(Sender: TObject);
begin
memo1.lines.LoadFromFile('notes.txt');
memo1.lines.LoadFromFile(UTF8ToSys('notes.txt'));
end;
initialization

View File

@ -7539,7 +7539,7 @@ begin
LoadFromXMLFile(fName)
else
begin
Stream := TFileStream.Create(FName, fmOpenRead);
Stream := TFileStream.Create(UTF8ToSys(FName), fmOpenRead);
LoadFromStream(Stream);
Stream.Free;
FileName := FName;
@ -7580,7 +7580,7 @@ begin
SaveToXMLFile(fName)
else
begin
Stream := TFileStream.Create(FName, fmCreate);
Stream := TFileStream.Create(UTF8ToSys(FName), fmCreate);
SaveToStream(Stream);
Stream.Free;
end;
@ -7680,7 +7680,7 @@ procedure TfrReport.LoadPreparedReport(FName: String);
var
Stream: TFileStream;
begin
Stream := TFileStream.Create(FName, fmOpenRead);
Stream := TFileStream.Create(UTF8ToSys(FName), fmOpenRead);
EMFPages.LoadFromStream(Stream);
Stream.Free;
CanRebuild := False;
@ -7690,7 +7690,7 @@ procedure TfrReport.SavePreparedReport(FName: String);
var
Stream: TFileStream;
begin
Stream := TFileStream.Create(FName, fmCreate);
Stream := TFileStream.Create(UTF8ToSys(FName), fmCreate);
EMFPages.SaveToStream(Stream);
Stream.Free;
end;
@ -7706,7 +7706,7 @@ var
begin
fb := TBitmap.Create;
fm := TStringList.Create;
Stream := TFileStream.Create(FName, fmOpenRead);
Stream := TFileStream.Create(UTF8ToSys(FName), fmOpenRead);
if Load then
begin
ReadMemo(Stream, fm);
@ -7736,7 +7736,7 @@ var
b: Byte;
pos, lpos: Integer;
begin
Stream := TFileStream.Create(FName, fmCreate);
Stream := TFileStream.Create(UTF8ToSys(FName), fmCreate);
frWriteMemo(Stream, Comm);
b := 0;
pos := Stream.Position;
@ -7978,7 +7978,7 @@ procedure TfrReport.ExportTo(Filter: TClass; aFileName: String);
var
s: String;
begin
ExportStream := TFileStream.Create(aFileName, fmCreate);
ExportStream := TFileStream.Create(UTF8ToSys(aFileName), fmCreate);
FCurrentFilter := TfrExportFilter(Filter.NewInstance);
FCurrentFilter.Create(ExportStream);
FCurrentFilter.OnBeginDoc;

View File

@ -24,7 +24,7 @@ uses
LCLType,LCLIntf,LCLProc,GraphType,Printers,
ObjectInspector,PropEdits,TypInfo,
ObjectInspector, PropEdits,TypInfo,
LR_Class, LR_Color,LR_Edit;
@ -4572,7 +4572,7 @@ begin
Filter := sFormFile + ' (*.frf)|*.frf|' +
sLazFormFile + ' (*.lrf)|*.lrf' +
'';
InitialDir:=ExtractFilePath(ParamStr(0));
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
FileName := CurDocName;
FilterIndex := 2;
if Execute then
@ -4610,7 +4610,7 @@ begin
sTemplFile + ' (*.frt)|*.frt|' +
sLazFormFile + ' (*.lrf)|*.lrf' +
'';
InitialDir:=ExtractFilePath(ParamStr(0));
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
FileName := CurDocName;
FilterIndex := 3;
if Execute then

View File

@ -61,14 +61,14 @@ begin
else
Path := frTemplateDir + DirectorySeparator;
LB1.Items.Clear;
R := FindFirst(Path + '*.frt', faAnyFile, SearchRec);
R := FindFirstUTF8(Path + '*.frt', faAnyFile, SearchRec);
while R = 0 do
begin
if (SearchRec.Attr and faDirectory) = 0 then
LB1.Items.Add(ChangeFileExt(SearchRec.Name, ''));
R := FindNext(SearchRec);
R := FindNextUTF8(SearchRec);
end;
FindClose(SearchRec);
FindCloseUTF8(SearchRec);
Memo1.Lines.Clear;
Image1.Picture.Clear;
Button1.Enabled := False;

View File

@ -129,7 +129,7 @@ Var i : Integer;
Stc,S : String;
Flag : Boolean;
begin
if FileExists(aFileName) then
if FileExistsUTF8(aFileName) then
begin
AssignFile(f,aFileName);
Reset(f);
@ -184,10 +184,10 @@ begin
TFMTAP := LongTimeFormat; //nl_langinfo(T_FMT_AMPM)
//KDE config
if DirectoryExists(ExpandFileName('~/.kde/share/config')) then
if DirectoryExistsUTF8(ExpandFileName('~/.kde/share/config')) then
begin
Lg:=Copy(GetEnvironmentVariable('LANG'),1,2); //Langue
Lg:=Copy(GetEnvironmentVariableUTF8('LANG'),1,2); //Langue
LstKde:=TStringList.Create;
try
ReadKdeFileConfig(Format('/usr/share/locale/l10n/%s/entry.desktop',[Lg]),'[KCM Locale]',LstKde);

View File

@ -95,7 +95,7 @@ procedure CreateMacOSXApplicationResources(const Filename,
sl.Add(' </array>');
sl.Add('</dict>');
sl.Add('</plist>');
sl.SaveToFile(PLInfoListFilename);
sl.SaveToFile(UTF8ToSys(PLInfoListFilename));
finally
sl.Free;
end;
@ -110,7 +110,7 @@ procedure CreateMacOSXApplicationResources(const Filename,
sl:=TStringList.Create;
try
sl.Add('APPL????');
sl.SaveToFile(PkgInfoFilename);
sl.SaveToFile(UTF8ToSys(PkgInfoFilename));
finally
sl.Free;
end;
@ -137,7 +137,7 @@ procedure CreateMacOSXApplicationResources(const Filename,
sl.Add('\');
sl.Add('');
sl.Add('}');
sl.SaveToFile(ReadmeFilename);
sl.SaveToFile(UTF8ToSys(ReadmeFilename));
finally
sl.Free;
end;
@ -186,7 +186,7 @@ end;
procedure CreateDirectoryInteractive(const Directory: string);
begin
if not CreateDir(Directory) then
if not CreateDirUTF8(Directory) then
raise EMacResourceException.Create('creating directory '+Directory+' failed');
end;

View File

@ -12,43 +12,43 @@ msgstr ""
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
#: messagecomposer:rscancel
#: messagecomposer.rscancel
msgid "Cancel"
msgstr "Abbrechen"
#: messagecomposer:skindofmessage
msgid "KIND OF MESSAGE"
msgstr ""
#: messagecomposer:smaskinput
msgid "Mask Input"
msgstr "Maskeneingabe"
#: messagecomposer:smessagecomposercaption
msgid "Message Composer ..."
msgstr "Message-Composer ..."
#: messagecomposer:snotimplementedyet
msgid "Not Implemented Yet"
msgstr "Noch nicht implementiert"
#: messagecomposer:rsok
#: messagecomposer.rsok
msgid "Ok"
msgstr "OK"
#: messagecomposer:ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr ""
#: messagecomposer:rstest
#: messagecomposer.rstest
msgid "Test"
msgstr "Test"
#: messagecomposer:spromptcaption
msgid "Text asking the user for input"
msgstr "Text um nach einer Eingabe zu fragen"
#: messagecomposer.skindofmessage
msgid "KIND OF MESSAGE"
msgstr ""
#: messagecomposer:smsgcaption
#: messagecomposer.smaskinput
msgid "Mask Input"
msgstr "Maskeneingabe"
#: messagecomposer.smessagecomposercaption
msgid "Message Composer ..."
msgstr "Message-Composer ..."
#: messagecomposer.smsgcaption
msgid "The message to be shown"
msgstr "Die anzuzeigende Meldung"
#: messagecomposer.snotimplementedyet
msgid "Not Implemented Yet"
msgstr "Noch nicht implementiert"
#: messagecomposer.spromptcaption
msgid "Text asking the user for input"
msgstr "Text um nach einer Eingabe zu fragen"
#: messagecomposer.ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr ""

View File

@ -4,43 +4,43 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: messagecomposer:smessagecomposercaption
msgid "Message Composer ..."
msgstr ""
#: messagecomposer:smsgcaption
msgid "The message to be shown"
msgstr ""
#: messagecomposer:spromptcaption
msgid "Text asking the user for input"
msgstr ""
#: messagecomposer:smaskinput
msgid "Mask Input"
msgstr ""
#: messagecomposer:ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr ""
#: messagecomposer:skindofmessage
msgid "KIND OF MESSAGE"
msgstr ""
#: messagecomposer:snotimplementedyet
msgid "Not Implemented Yet"
msgstr ""
#: messagecomposer:rstest
msgid "Test"
msgstr ""
#: messagecomposer:rsok
msgid "Ok"
msgstr ""
#: messagecomposer:rscancel
#: messagecomposer.rscancel
msgid "Cancel"
msgstr ""
#: messagecomposer.rsok
msgid "Ok"
msgstr ""
#: messagecomposer.rstest
msgid "Test"
msgstr ""
#: messagecomposer.skindofmessage
msgid "KIND OF MESSAGE"
msgstr ""
#: messagecomposer.smaskinput
msgid "Mask Input"
msgstr ""
#: messagecomposer.smessagecomposercaption
msgid "Message Composer ..."
msgstr ""
#: messagecomposer.smsgcaption
msgid "The message to be shown"
msgstr ""
#: messagecomposer.snotimplementedyet
msgid "Not Implemented Yet"
msgstr ""
#: messagecomposer.spromptcaption
msgid "Text asking the user for input"
msgstr ""
#: messagecomposer.ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr ""

View File

@ -9,43 +9,43 @@ msgstr ""
"Last-Translator: Maxim Ganetsky <maxkill@mail.ru>\n"
"Language-Team: \n"
#: messagecomposer:rscancel
#: messagecomposer.rscancel
msgid "Cancel"
msgstr "Отмена"
#: messagecomposer:skindofmessage
msgid "KIND OF MESSAGE"
msgstr "Тип сообщения"
#: messagecomposer:smaskinput
msgid "Mask Input"
msgstr "Маскировать ввод"
#: messagecomposer:smessagecomposercaption
msgid "Message Composer ..."
msgstr "Составитель сообщений ..."
#: messagecomposer:snotimplementedyet
msgid "Not Implemented Yet"
msgstr "Еще не реализовано"
#: messagecomposer:rsok
#: messagecomposer.rsok
msgid "Ok"
msgstr "ОК"
#: messagecomposer:ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr "Вызывающий исходный код"
#: messagecomposer:rstest
#: messagecomposer.rstest
msgid "Test"
msgstr "Тест"
#: messagecomposer:spromptcaption
msgid "Text asking the user for input"
msgstr "Текст запроса на ввод пользователем"
#: messagecomposer.skindofmessage
msgid "KIND OF MESSAGE"
msgstr "Тип сообщения"
#: messagecomposer:smsgcaption
#: messagecomposer.smaskinput
msgid "Mask Input"
msgstr "Маскировать ввод"
#: messagecomposer.smessagecomposercaption
msgid "Message Composer ..."
msgstr "Составитель сообщений ..."
#: messagecomposer.smsgcaption
msgid "The message to be shown"
msgstr "Отображаемое сообщение"
#: messagecomposer.snotimplementedyet
msgid "Not Implemented Yet"
msgstr "Еще не реализовано"
#: messagecomposer.spromptcaption
msgid "Text asking the user for input"
msgstr "Текст запроса на ввод пользователем"
#: messagecomposer.ssourcewrapper
msgid "SOURCE WRAPPER"
msgstr "Вызывающий исходный код"

View File

@ -12,15 +12,15 @@ msgstr ""
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Formatierbefehle"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "Verschönerungs-Datei"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Verschönerungs-Auswahl"

View File

@ -9,15 +9,15 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=utf-8\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Commandes de formatage"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "Formater le fichier"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Formater la sélection"

View File

@ -9,15 +9,15 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Perintah format"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "File Pretty-Format"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Pemilihan Pretty-Format"

View File

@ -10,15 +10,15 @@ msgstr ""
"Last-Translator: Valdas Jankūnas <skroblas@erdves.lt>\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Formatavimo komandos"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "Pretty-Format failas"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Pretty-Format žymėjimas"

View File

@ -4,15 +4,15 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Comandos de Formatação"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "Arquivo Pretty-Format"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Seleção Pretty-Format"

View File

@ -11,15 +11,15 @@ msgstr ""
"X-Poedit-Language: Polish\n"
"X-Poedit-Country: POLAND\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr ""
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr ""
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr ""

View File

@ -4,15 +4,15 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr ""
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr ""
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr ""

View File

@ -9,15 +9,15 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pfidesource:sdescrformatting
#: pfidesource.sdescrformatting
msgid "Formatting commands"
msgstr "Команды форматирования"
#: pfidesource:sdescrpffile
#: pfidesource.sdescrpffile
msgid "Pretty-Format File"
msgstr "Форматировать файл"
#: pfidesource:sdescrpfselection
#: pfidesource.sdescrpfselection
msgid "Pretty-Format Selection"
msgstr "Форматировать выбранное"

View File

@ -9,7 +9,7 @@ msgstr ""
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Drucken ..."

View File

@ -4,7 +4,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Tulosta..."

View File

@ -11,7 +11,7 @@ msgstr ""
"X-Poedit-Language: French\n"
"X-Poedit-Country: FRANCE\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Imprimer..."

View File

@ -9,7 +9,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr ""

View File

@ -10,7 +10,7 @@ msgstr ""
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Spausdinti..."

View File

@ -4,7 +4,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Imprimir"

View File

@ -11,7 +11,7 @@ msgstr ""
"X-Poedit-Language: Polish\n"
"X-Poedit-Country: POLAND\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Drukuj..."

View File

@ -4,7 +4,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr ""

View File

@ -9,7 +9,7 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ideprinting:sdescrpfselection
#: ideprinting.sdescrpfselection
msgid "Print..."
msgstr "Печать..."

View File

@ -53,7 +53,7 @@ uses SourcePrinter;
procedure TForm1.FormCreate(Sender: TObject);
begin
SynEdit1.Lines.LoadFromFile('main.pas');
SynEdit1.Lines.LoadFromFile(UTF8ToSys('main.pas'));
end;
procedure TForm1.Button1Click(Sender: TObject);

View File

@ -565,12 +565,12 @@ begin
end else
TPostscriptPrinterCanvas(Canvas).OutPutFileName:='';
if not aAborted and FileExists(FOutputFileName) then begin
if not aAborted and FileExistsUTF8(FOutputFileName) then begin
{$IFDEF LogPrintoutFile}
CopyFile(FOutputFileName, 'printjob'+ExtractFileExt(FOutputFileName));
{$ENDIF}
PrintFile(FOutputFileName);
DeleteFile(FOutputFilename);
DeleteFileUTF8(FOutputFilename);
end;
end;
@ -585,7 +585,7 @@ begin
if fcupsPPDName<>'' then
begin
DeleteFile(fcupsPPDName);
DeleteFileUTF8(fcupsPPDName);
fcupsPPDName:='';
end;
@ -676,7 +676,7 @@ begin
if fcupsPPDName<>'' then
begin
DeleteFile(fcupsPPDName);
DeleteFileUTF8(fcupsPPDName);
fcupsPPDName:='';
end;
end;

View File

@ -209,7 +209,7 @@ begin
FTemplateDir:=IncludeTrailingPathDelimiter(ATemplateDir);
D:=FTemplateDir;
try
If FindFirst(D+AllFilesMask,faDirectory,Info)=0 then
If FindFirstUTF8(D+AllFilesMask,faDirectory,Info)=0 then
Repeat
If ((Info.Attr and faDirectory)<>0)
and not ((Info.Name='.') or (Info.Name='..') or (Info.Name='')) then
@ -219,9 +219,9 @@ begin
if (name='') or (directory='') // skip invalid template folders
then delete(count-1); // this prevents IDE hanging
end;
Until FindNext(Info)<>0;
Until FindNextUTF8(Info)<>0;
finally
FindClose(Info);
FindCloseUTF8(Info);
end;
end;
@ -282,7 +282,7 @@ begin
L:=TStringList.Create;
Try
FN:=FDirectory+'project.ini';
If FileExists(FN) then
If FileExistsUTF8(FN) then
begin
With TMemInifile.Create(FN) do
try
@ -300,9 +300,9 @@ begin
end;
end;
FN:=Directory+'description.txt';
If FileExists(FN) then
If FileExistsUTF8(FN) then
begin
L.LoadFromFile(FN);
L.LoadFromFile(UTF8ToSys(FN));
FDescription:=L.Text;
end;
GetFileList(FDirectory);
@ -345,14 +345,14 @@ Var
I : Integer;
begin
If not ForceDirectories(BaseDir) then
If not ForceDirectoriesUTF8(BaseDir) then
Raise ETemplateError.CreateFmt(SErrCouldNotCreateDir,[BaseDir]);
For I:=0 to FileCount-1 do
begin
RFN:=ExtractRelativePath(Directory,FileNames[i]);
RFN:=SubstituteString(ExtractFilePath(RFN),Values);
If (RFN<>'') Then
If not ForceDirectories(BaseDir+RFN) then
If not ForceDirectoriesUTF8(BaseDir+RFN) then
Raise ETemplateError.CreateFmt(SErrCouldNotCreateDir,[BaseDir+RFN]);
end;
end;
@ -394,7 +394,7 @@ begin
L:=TstringList.Create;
try
CreateFile(SrcFN,L,Values);
L.SaveToFile(DestFN);
L.SaveToFile(UTF8ToSys(DestFN));
Finally
L.Free;
end;
@ -407,25 +407,25 @@ Var
Info : TSearchRec;
begin
If FindFirst(Dir+AllFilesMask,0,Info)=0 then
If FindFirstUTF8(Dir+AllFilesMask,0,Info)=0 then
try
repeat
if Not SpecialFile(info.name) then
FFiles.Add(Dir+Info.Name);
Until (FindNext(Info)<>0);
Until (FindNextUTF8(Info)<>0);
finally
FindClose(Info);
FindCloseUTF8(Info);
end;
if Recurse then
If (FindFirst(Dir+AllFilesMask,0,Info)=0) then
If (FindFirstUTF8(Dir+AllFilesMask,0,Info)=0) then
try
repeat
if ((Info.attr and faDirectory)<>0) and
(Info.Name<>'.') and (info.Name<>'..') and (Info.Name<>'') then
GetFileList(Dir+Info.Name+PathSeparator);
until FindNext(Info)<>0;
until FindNextUTF8(Info)<>0;
finally
FindClose(Info);
FindCloseUTF8(Info);
end;
end;
@ -445,9 +445,9 @@ Var
begin
D1:=IncludeTrailingPathDelimiter(SrcDir);
D2:=IncludeTrailingPathDelimiter(DestDir);
If not ForceDirectories(D2) then
If not ForceDirectoriesUTF8(D2) then
Raise ETemplateError.CreateFmt(SErrCouldNotCreateDir,[D2]);
If FindFirst(D1+AllFilesMask,0,Info)=0 then
If FindFirstUTF8(D1+AllFilesMask,0,Info)=0 then
try
repeat
N:=Info.Name;
@ -457,21 +457,21 @@ begin
N:=DefaultFileSubstitutes(N);
CopyAndSubstituteFile(D1+Info.Name,D2+SubstituteString(N,Values),Values);
end;
Until (FindNext(Info)<>0);
Until (FindNextUTF8(Info)<>0);
finally
FindClose(Info);
FindCloseUTF8(Info);
end;
if Recurse then
If (FindFirst(D1+AllFilesmask,0,Info)<>0) then
If (FindFirstUTF8(D1+AllFilesmask,0,Info)<>0) then
try
repeat
if ((Info.attr and faDirectory)<>0) and
(Info.Name<>'.') and (info.Name<>'..') and (Info.Name<>'')
then
CopyAndSubstituteDir(D1+Info.Name,D2+SubstituteString(Info.Name,Values),Values);
until FindNext(Info)<>0;
until FindNextUTF8(Info)<>0;
finally
FindClose(Info);
FindCloseUTF8(Info);
end;
end;

View File

@ -337,7 +337,7 @@ procedure SaveFormPlacement(Form: TForm; const IniFileName: string);
var
IniFile: TInifile;
begin
IniFile := TIniFile.Create(IniFileName);
IniFile := TIniFile.Create(UTF8ToSys(IniFileName));
try
WriteFormPlacement(Form, IniFile, Form.ClassName);
finally
@ -420,7 +420,7 @@ procedure RestoreFormPlacement(Form: TForm; const IniFileName: string);
var
IniFile: TIniFile;
begin
IniFile := TIniFile.Create(IniFileName);
IniFile := TIniFile.Create(UTF8ToSys(IniFileName));
try
ReadFormPlacement(Form, IniFile, Form.ClassName, True, True);
finally
@ -436,7 +436,7 @@ begin
Result := '';
for I := 0 to MaxInt do begin
CurrentName := Format(FileNameMask, [I]);
if not FileExists(IncludeTrailingPathDelimiter(Path) + CurrentName) then
if not FileExistsUTF8(IncludeTrailingPathDelimiter(Path) + CurrentName) then
begin
Result := CurrentName;
Exit;

View File

@ -248,7 +248,7 @@ Function GetDefaultIniName : String;
begin
{$ifdef unix}
Result:=IncludeTrailingPathDelimiter(GetEnvironmentVariable('HOME'))
Result:=IncludeTrailingPathDelimiter(GetEnvironmentVariableUTF8('HOME'))
+'.'+ExtractFileName(Application.ExeName)
{$else}
@ -583,7 +583,7 @@ procedure TFormPlacement.IniNeeded(ReadOnly: Boolean);
begin
if ReadOnly then ;
if IniFile = nil then
FIniFile := TIniFile.Create(IniFileName);
FIniFile := TIniFile.Create(UTF8ToSys(IniFileName));
end;
procedure TFormPlacement.IniFree;

View File

@ -147,7 +147,7 @@ function TLazyTextConverterToolClasses.GetTempFilename: string;
var
BaseDir: String;
begin
BaseDir:=GetCurrentDir;
BaseDir:=GetCurrentDirUTF8;
Result:=FileProcs.GetTempFilename(BaseDir,'convert_');
end;

View File

@ -75,7 +75,7 @@ end;
procedure TSQLStringsPropertyEditorDlg.OpenToolButtonClick(Sender: TObject);
begin
if(OpenDialog.Execute)then
SQLEditor.Lines.LoadFromFile(OpenDialog.FileName);
SQLEditor.Lines.LoadFromFile(UTF8ToSys(OpenDialog.FileName));
end;
//---------------------------------------------------------------------------//
@ -134,7 +134,7 @@ end;
procedure TSQLStringsPropertyEditorDlg.SaveToolButtonClick(Sender: TObject);
begin
if(SaveDialog.Execute)then
SQLEditor.Lines.SaveToFile(SaveDialog.FileName);
SQLEditor.Lines.SaveToFile(UTF8ToSys(SaveDialog.FileName));
end;
initialization

View File

@ -135,7 +135,7 @@ begin
try
// In case Filename is a relative one, change dir to project dir
// so the datafile will be created in the right place
OldDir:=GetCurrentDir;
OldDir:=GetCurrentDirUTF8;
if ExtractFilePath (LazarusIDE.ActiveProject.MainFile.FileName) <> '' then
ChDir(ExtractFilePath (LazarusIDE.ActiveProject.MainFile.FileName));
Dataset:=ADataset;

View File

@ -60,7 +60,7 @@ uses
QClipbrd
{$ELSE}
{$IFDEF SYN_LAZARUS}
FPCAdds, LCLIntf, LCLType,
FileUtil, FPCAdds, LCLIntf, LCLType,
{$ELSE}
Windows,
{$ENDIF}
@ -500,7 +500,7 @@ end;
procedure TSynCustomExporter.SaveToFile(const AFileName: string);
begin
fBuffer.Position := 0;
fBuffer.SaveToFile(AFileName);
fBuffer.SaveToFile(UTF8ToSys(AFileName));
end;
procedure TSynCustomExporter.SaveToStream(AStream: TStream);

View File

@ -40,7 +40,7 @@ uses
{$ELSE}
Graphics,
{$IFDEF SYN_LAZARUS}
LCLProc, LCLIntf, LCLType, AvgLvlTree,
FileUtil, LCLProc, LCLIntf, LCLType, AvgLvlTree,
{$ELSE}
Windows,
{$ENDIF}
@ -1050,7 +1050,7 @@ function TSynCustomHighlighter.LoadFromFile(AFileName : String): boolean;
VAR AIni : TIniFile;
i : Integer;
begin
AIni := TIniFile.Create(AFileName);
AIni := TIniFile.Create(UTF8ToSys(AFileName));
try
with AIni do
begin
@ -1067,7 +1067,7 @@ function TSynCustomHighlighter.SaveToFile(AFileName : String): boolean;
var AIni : TIniFile;
i: integer;
begin
AIni := TIniFile.Create(AFileName);
AIni := TIniFile.Create(UTF8ToSys(AFileName));
try
with AIni do
begin

View File

@ -104,7 +104,7 @@ type
constructor Create;
destructor Destroy; override;
function FindAll(const NewText: string): integer;
function FindFirst(const NewText: string): Integer;
function FindFirstUTF8(const NewText: string): Integer;
procedure FixResults(First, Delta: integer);
function Next: Integer;
{$IFDEF SYN_LAZARUS}
@ -988,7 +988,7 @@ begin
// never shrink Capacity
fResults.Count := 0;
{$ENDIF}
Found := FindFirst(NewText);
Found := FindFirstUTF8(NewText);
while Found > 0 do
begin
{$IFDEF SYN_LAZARUS}
@ -1004,7 +1004,7 @@ begin
Result := fResults.Count;
end;
function TSynEditSearch.FindFirst(const NewText: string): Integer;
function TSynEditSearch.FindFirstUTF8(const NewText: string): Integer;
begin
Result := 0;
fTextLen := Length(NewText);

View File

@ -44,7 +44,7 @@ interface
uses
Classes, SysUtils,
{$IFDEF SYN_LAZARUS}
LCLProc, FPCAdds, LCLIntf, LCLType,
FileUtil, LCLProc, FPCAdds, LCLIntf, LCLType,
{$ELSE}
Windows,
{$ENDIF}
@ -371,7 +371,7 @@ type
constructor TSynEditFileReader.Create(const FileName: string);
begin
inherited Create;
fFiler := TFileStream.Create(FileName, fmOpenRead{ ToDo: or fmShareDenyWrite});
fFiler := TFileStream.Create(UTF8ToSys(FileName), fmOpenRead{ ToDo: or fmShareDenyWrite});
fFileSize := fFiler.Size;
fFiler.Seek(0, soFromBeginning);
end;
@ -462,7 +462,7 @@ type
constructor TSynEditFileWriter.Create(const FileName: string);
begin
inherited Create;
fFiler := TFileStream.Create(FileName, fmCreate);
fFiler := TFileStream.Create(UTF8ToSys(FileName), fmCreate);
fFiler.Seek(0, soFromBeginning);
end;

Some files were not shown because too many files have changed in this diff Show More