Наконецто, для русского языка написал
//**********************************************************
function toUtf8code(St: string): string;
var
i,n,pr: Integer;
s:string;
ch,old:char;
oldisruKey:boolean;
begin
n:=0;
oldisruKey:=false;
for i:=0 to length(st)-1do
begin
ch:=getChar(st,i);
n:=ord(ch);
If n<208 then if not oldisruKey then s:=s+ch;
if oldisruKey then
begin
if old=chr(208) then begin
s:=s+chr( stringtointeger((integertostring((ord(ch)) +896) )));
end;
if old=chr(209) then begin
s:=s+chr( stringtointeger((integertostring((ord(ch)) +960) )));
end;
oldisruKey:=false;
end;
if ch>=chr(208) then oldisruKey:=true;
old:=ch; //208 154
end;
toUtf8code:=s;
end;
//1106 8216