-
Notifications
You must be signed in to change notification settings - Fork 1
/
Transcoder.dpr
46 lines (39 loc) · 974 Bytes
/
Transcoder.dpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
program Transcoder;
{$IFDEF FPC}
{$MODE Delphi}
//{$CODEPAGE cp1251}
{$GOTO OFF}
{$ENDIF}
{$APPTYPE CONSOLE}
uses
SysUtils, Classes, uDCLStringsRes, uStringParams;
var
Path, S, tfn, sfn:string;
T, TOut:Text;
DecodeType:TTranscodeDataType;
begin
If ParamCount>0 then
Begin
DecodeType:=tdtDOS;
tfn:=ChangeFileExt(ExtractFileName(ParamStr(1)), '');
sfn:=ChangeFileExt(ExtractFileName(ParamStr(2)), '');
LoadTranscodeFile(DecodeType, ParamStr(1), 1049);
AssignFile(T, ParamStr(2));
ReSet(T);
AssignFile(TOut, ExtractFilePath(ParamStr(2))+sfn+'_'+tfn+ExtractFileExt(ParamStr(2)));
ReWrite(TOut);
While not EOF(T) do
begin
ReadLn(T, S);
S:=Transcode(DecodeType, S);
WriteLn(TOut, S);
end;
CloseFile(TOut);
CloseFile(T);
End
Else
Begin
WriteLn(ExtractFileName(ParamStr(0))+' TranscodeTable.ext SourceFile.txt');
ReadLn;
End;
end.