' + #13 else Result := Result + s[i]; end else begin case s[i] of 'S': ; ! 'b', 'B', ! 'x', 'X': begin Result := Result + ''; Normalize := '' + Normalize; end; ! 'i', 'I': begin Result := Result + ''; Normalize := '' + Normalize; end; ! 'd', 'D': begin Number := Copy(s, i, 5); if Number = 'DJ255' then Inc(i, 4); Result := Result + Normalize; Normalize := ''; end; ! 'm', 'M': begin Number := Copy(s, i, 7); if Number = 'MSJ243>' then begin Inc(i, 5); Result := Result + ''; Normalize := '' + Normalize; end; end; ! 'v', 'V': begin Result := Result + ''; Normalize := '' + Normalize; end; ! '^': begin Result := Result + ''; Normalize := '' + Normalize; end; ! 'R': begin Result := Result + '
'; end; ! 'T': begin { TO DO: Process hyperlink. } end; ! 'J': begin Inc(i); Number := Copy(s, i, 3); if Number = '243' then begin Result := Result + ''; Normalize := '' + Normalize; end else begin Result := Result + Normalize; if CharSet = 1 then Result := Result + '' else Result := Result + ''; Normalize := ''; end; end; ! 'F': begin Inc(i); Number := Copy(s, i, 3); Inc(i, 2); if Number = '128' then begin CharSet := 2; Result := Result + ''; end else begin CharSet := 1; Result := Result + '' end; Normalize := '' + Normalize; end; ! 'P': begin Number := Copy(s, i, 3); Result := Result + ''; Normalize := '' + Normalize; Inc(i, 2); end; ! 'H': begin Number := Copy(s, i, 4); Inc(i, 3); if Number = 'HIDE' then break; end; ! '$': begin Inc(i); Number := Copy(s, i, 4); if Number = 'E1/2' then Result := Result + '½' else if Number = 'E1/4' then Result := Result + '¼' else if Number = 'E3/4' then Result := Result + '¾'; Inc(i, 3); end; ! '0'..'9': begin Number := ''; while s[i] in ['0'..'9'] do begin Number := Number + s[i]; Inc(i); end; Dec(i); Code := StrToInt(Number); if CharSet = 2 then begin if (Code > 31) and (Code < 217) then begin case Code of 032: Result := Result + ' '; 033: Result := Result + '¡'; 034: Result := Result + '"'; { Should be inverted. ࢘} 035: Result := Result + '#'; 036: Result := Result + '$'; { Should be inverted. ࢛} 037: Result := Result + '%'; 038: Result := Result + '&'; 039: Result := Result + '''; 040: Result := Result + '('; 041: Result := Result + ')'; 042: Result := Result + '*'; 043: Result := Result + '+'; 044: Result := Result + ','; 045: Result := Result + '—'; 046..057: Result := Result + Char(Code); 058: Result := Result + ':'; 059: Result := Result + ';'; 060: Result := Result + '<'; 061: Result := Result + '='; 062: Result := Result + '>'; 063: Result := Result + '?'; 064: Result := Result + '@'; 065,066: Result := Result + Char(Code); 067: Result := Result + 'Χ'; 068: Result := Result + 'Δ'; 069: Result := Result + 'E'; 070: Result := Result + 'Ι'; 071: Result := Result + 'Γ'; 072: Result := Result + 'Η'; 073: Result := Result + 'Ι'; 074: Result := Result + 'J'; 075: Result := Result + 'Κ'; 076: Result := Result + 'Λ'; 077: Result := Result + 'Μ'; 078: Result := Result + 'Ν'; 079: Result := Result + 'Ο'; 080: Result := Result + 'Π'; 081: Result := Result + 'Θ'; 082: Result := Result + 'Ρ'; 083: Result := Result + 'Σ'; 084: Result := Result + 'Τ'; 085: Result := Result + 'Υ'; 086: Result := Result + 'V'; end; end; end else begin if Code in [33..222] then Result := Result + CharSet1[Code] else Result := Result + Char(Code); end; end; end; end; Inc(i); end; Result := Result + Normalize; end; {gives the ascii symbol for a & tag} function HTMLSymbolToASCII(const s:string):string; var i:char; begin Result := ' '; for i:= LOW(ANSIToHTMLMap) to HIGH(ANSItoHTMLMap) do begin if CompareStr(ANSItoHTMLMap[i],s) = 0 then begin Result := i; exit; end; end; end; function HTMLtoASCII(const text:string):string; var inTag:boolean; L,i:integer; s,Tag:string; begin {remove tags} s := RemoveTags(text); {process symbols} Result := ''; InTag := False; L := Length(s); for i := 1 to L do begin if s[i]='&' then begin inTag := True; Tag:=''; end; if not inTag then Result := Result + s[i] else Tag := Tag + s[i]; if s[i]=';' then begin inTag := False; Result := Result + HTMLSymbolToASCII(tag); end; end; end; function ASCIIto7Bit(const s:string):string; var i:integeR; begin Result := ''; for i := 1 to length(s) do begin if s[i] > '™' then result := result + ANSITo7Bit[s[i]] else result := result + s[i]; end; end; function uniformText(const text:string):string; var i:integer; begin Result := ''; for i := 1 to length(text) do begin if (i>1) and (isAlpha(text[i-1]) and isNumeric(text[i])) or (isNumeric(text[i-1]) and isAlpha(text[i])) then Result := Result + ' '; if isAlphanumeric(text[i]) then result := result + AnsiUppercase(text[i]) else result := result + ' '; end; end; end.