/* rr.cmd v.1.0 ४஢ ⥪⮢ ࠧ ଠ⮢ ࠧ ন ஢ WIN (1251), KOI8 (878), DOS (866) ਬ: rr.cmd windos marazm.txt - ॢ 䠩 marazm.txt ஢ WIN DOS rr.cmd koidos marazm.in marazm.out - 筮 KOI DOS, १ 䠩 marazm.out , http://lleo.aha.ru */ call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' call SysLoadFuncs arg Cod FileIn FileOut Endstr /* cod = DOSWIN filein = chast.txt fileout = '' endstr = '' */ if (FileIn='')|(Endstr<>'') then do ; say "ࠢ 㬥! ਬ: rr DOSWIN marazm.txt marazm.out" ; exit ; end If FileOut=''|FileOut=FileIn Then FileOut=SysTempFileName(substr(FileIn,1,lastpos('\',FileIn))||'$temp$??.???') else do call SysFileDelete(FileOut) tempfileflag=0 end parse value SysCurPos() with CurY CurX if CurY <> 0 then CurY = CurY - 1 say 'encoding' substr(Cod,1,3) '->' substr(Cod,4,3) T2=settable(1) T1=settable(4) if lines(FileIn)=0 then do ; say "Open error:" FileIn ; exit ; end do while lines(FileIn)<>0 s=linein(FileIn) s=translate(s,T1,T2) a=lineout(FileOut,s) end a=lineout(FileOut) a=lineout(FileIn) if tempfileflag<>0 then do call SysFileDelete(FileIn) '@echo off' rename '"'||FileOut||'"' '"'||FileIn||'"' end a=SysCurPos(CurY,21) say 'sucsessfull' exit SetTable: ARG modecode select when substr(Cod,modecode,3) = 'WIN' then return '' when substr(Cod,modecode,3) = 'KOI' then return 'аѠ' when substr(Cod,modecode,3) = 'DOS' then return '' otherwise ; do ; say "ࠢ ࠬ!" ; exit ; end end