Re: URI-1.54 and punycode

"Roman V. Nikolaev" <[email protected]> Fri, 09 Apr 2010 14:38:25 +0400
Newsgroups gmane.comp.lang.perl.modules.lwp
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-----