Re: URI-1.54 and punycode

[email protected] ("Roman V. Nikolaev")
Newsgroups perl.libwww
Message-ID <[email protected]>
Gisle Aas пишет:
> On Apr 7, 2010, at 10:02 , Роман Николаев wrote:
> 
>> Hello. Please help me to use your module URI-1.54. I see for URI::_punycode package, but not understand how to use it.
>> I need convert domain names from local to punycode.
>>
>> Example: "кофемашина.su" (some_russian_letters.su) to "xn--80aannhnjd8c2b.su"
>>
>> I try to:
>>
>> use URI;
>> my $uri = URI->new("some_russian_letters.su", "http");
> 
> The problem here is that this actually set up the 'path' portion of the URL to be the "some_russian_letters.su".  The IDNA stuff only applies to the hostname portion.  An example that works (for me) is:
> 
> ----------------------------------------%<-------------
> #!perl -lw
> use utf8;
> use URI;
> my $u = URI->new("http://кофемашина.su");
> print $u->host;
> ----------------------------------------%<-------------
> 
> This prints "xn--80aannhnjd8c2b.su".
> 
> --Gisle
> 

Thanks. It`s work =)

> 
> 
>> my $a = $uri->canonical;
>> or
>> my $a = $uri->iri;
>>
>> but $a is not punycode encoded string, just standart uri encoding: some %xx%xx%xx%xx....su
>>
>> Can You get me example or link to example?
>>
>> --
>>
>>        Roman V. Nikolaev
>>
>> mail:        [email protected]
>> icq:         198-364-657
>> jabber:      [email protected]
>> site:        http://www.rshadow.ru
> 


-- 

         Roman V. Nikolaev

mail:        [email protected]
icq:         198-364-657
jabber:      [email protected]
site:        http://www.rshadow.ru
signature.asc (application/pgp-signature, 262 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/A6EACgkQ6hKpBt4OHBt1CQCdFN0rRLAnMiaf6BXPeE6vGUqh
814AnjiI43D0cajbRFSDQ0f3h5UpRCMF
=7CX+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.