/* Convert a file in UTF-8 format into the current codepage. */ /* The converted output is dumped to STDOUT (redirect using '>' to save). */ CALL RxFuncAdd 'ULSLoadFuncs', 'RXULS', 'ULSLoadFuncs' CALL ULSLoadFuncs PARSE ARG infile IF infile == '' THEN DO SAY 'Syntax: UTFFILE ' RETURN 0 END DO WHILE LINES( infile ) > 0 utfline = LINEIN( infile ) IF utfline = '' THEN ITERATE cpline = ULSConvertCodepage( utfline, 1208 ) CALL LINEOUT 'STDOUT:', cpline END CALL STREAM infile, 'C', 'CLOSE' CALL ULSDropFuncs RETURN 0