Показать сообщение отдельно
Старый 21.10.2008, 18:21   #18
Kurdt
ПроЭктировщик
 
Регистрация: 28.03.2007
Сообщений: 194
Написано 7 полезных сообщений
(для 25 пользователей)
Re: Конвертирование кодировки utf для отображ&

Наконецто, для русского языка написал

//**********************************************************

function toUtf8code(Ststring): string;
var
  
i,n,prInteger;
  
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+chrstringtointeger((integertostring((ord(ch))  +896) )));
                    
end;

            if 
old=chr(209)  then begin
                    s
:=s+chrstringtointeger((integertostring((ord(ch))  +960) )));
                    
end;


                    
oldisruKey:=false;
                
end;


if 
ch>=chr(208then oldisruKey:=true;

old:=ch//208 154


                      
end;
        
toUtf8code:=s;
end;

//1106 8216 
(Offline)
 
Ответить с цитированием