diff --git a/packages/pastojs/src/pas2jslibcompiler.pp b/packages/pastojs/src/pas2jslibcompiler.pp index 80f66f8756..6f3b377a25 100644 --- a/packages/pastojs/src/pas2jslibcompiler.pp +++ b/packages/pastojs/src/pas2jslibcompiler.pp @@ -67,6 +67,8 @@ Type FOnWriteJSCallBack: TWriteJSCallBack; FOnWriteJSData: Pointer; FReadBufferLen: Cardinal; + function GetLogEncoding: String; + procedure SetLogEncoding(AValue: String); Protected Function DoWriteJSFile(const DestFilename: String; aWriter: TPas2JSMapper): Boolean; override; Procedure GetLastError(AError : PAnsiChar; Var AErrorLength : Longint; @@ -80,6 +82,7 @@ Type Function LibraryRun(ACompilerExe, AWorkingDir : PAnsiChar; CommandLine : PPAnsiChar; DoReset : Boolean) :Boolean; {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; Property LastError : String Read FLastError Write FLastError; Property LastErrorClass : String Read FLastErrorClass Write FLastErrorClass; + property LogEncoding: String read GetLogEncoding write SetLogEncoding; Property OnLibLogCallBack : TLibLogCallBack Read FOnLibLogCallBack Write FOnLibLogCallBack; Property OnLibLogData : Pointer Read FOnLibLogData Write FOnLibLogData; Property OnWriteJSCallBack : TWriteJSCallBack Read FOnWriteJSCallBack Write FOnWriteJSCallBack; @@ -107,6 +110,7 @@ Function RunPas2JSCompiler(P : PPas2JSCompiler; ACompilerExe, AWorkingDir : PAns Procedure FreePas2JSCompiler(P : PPas2JSCompiler); {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; Function GetPas2JSCompiler : PPas2JSCompiler; {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; Procedure GetPas2JSCompilerLastError(P : PPas2JSCompiler; AError : PAnsiChar; Var AErrorLength : Longint; AErrorClass : PAnsiChar; Var AErrorClassLength : Longint); {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; +procedure SetPas2JSLogEncoding(P : PPas2JSCompiler; Enconding: PAnsiChar); {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; implementation @@ -120,6 +124,16 @@ begin Result:=OnReadDir(FOnReadDirData,Dir,PAnsiChar(Dir.Path)); end; +function TLibraryPas2JSCompiler.GetLogEncoding: String; +begin + Result := Log.Encoding; +end; + +procedure TLibraryPas2JSCompiler.SetLogEncoding(AValue: String); +begin + Log.Encoding := AValue; +end; + function TLibraryPas2JSCompiler.DoWriteJSFile(const DestFilename: String; aWriter: TPas2JSMapper): Boolean; Var @@ -344,5 +358,10 @@ begin TLibraryPas2JSCompiler(P).GetLastError(AError,AErrorLength,AErrorClass,AErrorClassLength); end; +procedure SetPas2JSLogEncoding(P : PPas2JSCompiler; Enconding: PAnsiChar); {$IFDEF UseCDecl}cdecl{$ELSE}stdcall{$ENDIF}; +begin + TLibraryPas2JSCompiler(P).LogEncoding := Enconding; +end; + end. diff --git a/utils/pas2js/pas2jslib.pp b/utils/pas2js/pas2jslib.pp index f0376e38dd..0657b571db 100644 --- a/utils/pas2js/pas2jslib.pp +++ b/utils/pas2js/pas2jslib.pp @@ -17,7 +17,8 @@ exports AddPas2JSDirectoryEntry, SetPas2JSUnitAliasCallBack, SetPas2JSCompilerLogCallBack, - GetPas2JSCompilerLastError; + GetPas2JSCompilerLastError, + SetPas2JSLogEncoding; end.