Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cyrillic domain name

Tags:

delphi

How I can get a page from internet, if I have cyrillic domain (http://президент.рф/) with Delphi 7.

Thanks!

like image 420
user515503 Avatar asked Nov 26 '10 12:11

user515503


People also ask

What domain does Russia use?

ru” is the ccTLD reserved for use in Russia; “. su” was the ccTLD registered by the Soviet Union but that remains in use by Russia; and “. pф” (representing “rf” in Cyrillic) is another Russian ccTLD under ICANN's Internationalized Domain Name (IDN) program.

What domain does Ukraine use?

ua is the Internet country code top-level domain (ccTLD) for Ukraine. To register at the second-level (example) domainname.ua, possession of the exact trademark (matching the domain name) is required.

Is there a .space domain?

The . SPACE domain lets innovators and creative minds create their own unique corner of the web. Perfect for freelancers, writers, designers, and more, the open-ended domain allows users to create a web environment unique to their interests. In a more literal sense, .

Is there a .code domain?

A . CODES domain name could be used to refer to programming code, video game tips and tricks, codes of conduct, or anything else related to the word “code.” It's an open domain extension with no restrictions.


1 Answers

I have written a punycode encoder/decoder available here:

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

usage:

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('рф')]);
like image 135
Henri Gourvest Avatar answered Sep 21 '22 18:09

Henri Gourvest