2010-11-26 10 views
7

कैसे मैं अगर मैं सिरिलिक डोमेन (http: //президент.рф/) है इंटरनेट से एक पृष्ठ पर प्राप्त कर सकते हैं, डेल्फी 7.सिरिलिक डोमेन नाम

साथ

धन्यवाद!

उत्तर

10

मैं यहाँ एक पनीकोड ​​एनकोडर/विकोडक उपलब्ध लिखा है:

http://code.google.com/p/delphionrails/source/browse/trunk/src/dorPunyCode.pas

उपयोग:

function PEncode(const str: UnicodeString): AnsiString; 
var 
    len: Cardinal; 
begin 
    Result := ''; 
    if (PunycodeEncode(Length(str), PPunyCode(str), len) = pcSuccess) and (Length(str) + 1 <> len) then 
    begin 
    SetLength(Result, len); 
    PunycodeEncode(Length(str), PPunyCode(str), len, PByte(Result)); 
    Result := 'xn--' + Result; 
    end else 
    Result := AnsiString(str); 
end; 

Format('http://%s.%s', [PEncode('президент'), PEncode('рф')]); 
+0

डेल्फी के लिए 7 परिवर्तन WideString साथ UnicodeString –

+1

अपने जवाब और काम के लिए धन्यवाद! – user515503

संबंधित मुद्दे