Converting Windows-1251 encoding to Koi8-R

Please suggest or direct: how to translate Windows-1251 encoding strings to Koi8-R

Author: Deleted, 2014-05-21

1 answers

For example, using character matching tables:

Http://forum.ixbt.com/topic.cgi?id=40:1066

function Convert(const s: string): string;
const
  ReplacementTable: array[#128..#255] of Char = (..,..,..);
var
  i: integer;
begin
  Result := s;

  for i := 1 to Length(s) do
    if s[i] > #127 then
      Result[i] := ReplacementTable[s[i]];
end;
 1
Author: Kromster, 2015-09-03 07:59:45