Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 67615
Status: rejected
Priority: 0/
Queue: URI

People
Owner: Nobody in particular
Requestors: vadim [...] price.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From vadim [...] price.ru Wed Apr 20 09: 47:53 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-6.9 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Spam-Flag: NO
Message-ID: <201104201747.41761.vadim [...] price.ru>
content-type: Text/Plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Organization: price.ru
X-Spam-Score: -6.9
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 80F2B241959 for <cpan-bug+uri [...] hipster.bestpractical.com>; Wed, 20 Apr 2011 09:47:53 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KKns2u1J-jPh for <cpan-bug+uri [...] hipster.bestpractical.com>; Wed, 20 Apr 2011 09:47:52 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 9EF1B2418E7 for <bug-uri [...] rt.cpan.org>; Wed, 20 Apr 2011 09:47:51 -0400 (EDT)
Received: (qmail 10699 invoked by uid 103); 20 Apr 2011 13:47:50 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 20 Apr 2011 13:47:50 -0000
Received: from ghost.com.price.ru (HELO mx1.price.ru) (81.19.75.32) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Wed, 20 Apr 2011 06:47:46 -0700
Received: from [172.16.0.2] (helo=smtp.com.price.ru) by mx1.price.ru with esmtp (Exim 4.71) (envelope-from <vadim [...] price.ru>) id 1QCXkr-0002St-TM for bug-uri [...] rt.cpan.org; Wed, 20 Apr 2011 17:47:41 +0400
Received: from [172.16.2.105] (helo=vadim.localnet) by smtp.com.price.ru with esmtp (Exim 4.66) (envelope-from <vadim [...] price.ru>) id 1QCXkr-0008Sw-SL for bug-uri [...] rt.cpan.org; Wed, 20 Apr 2011 17:47:41 +0400
Delivered-To: cpan-bug+uri [...] hipster.bestpractical.com
Subject: punycode bug
User-Agent: KMail/1.12.4 (Linux/2.6.31.14-0.8-default; KDE/4.3.5; x86_64; ; )
Return-Path: <vadim [...] price.ru>
X-RT-Mail-Extension: uri
X-Original-To: cpan-bug+uri [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Wed, 20 Apr 2011 17:47:41 +0400
X-Spam-Level:
To: bug-uri [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Vadim Menshakov <vadim [...] price.ru>
X-RT-Original-Encoding: us-ascii
Content-Length: 384
Download (untitled) / with headers
text/plain 384b
incorrect punycode: # INCORRECT: cat domain.txt | iconv -t utf8 | perl -MURI -lne 'chomp; print URI->new($_)->canonical' http://xn--adl9opab4bsg0pbbbcbmfb.xn--ai3ub/ # CORRECT: cat domain.txt | iconv -t utf8 | perl -MURI::UTF8::Punycode -nle 'chomp; die unless m#^(http://)(.+?)(\.)(.+?)(/)$#; print $1 . puny_enc($2) . $3 . puny_enc($4) . $5;' http://xn--b1agaxleqp7a.xn--p1ai/
MIME-Version: 1.0
In-Reply-To: <201104201747.41761.vadim [...] price.ru>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <201104201747.41761.vadim [...] price.ru>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18808-1303416599-1859.67615-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 54
What's the domain name you try to encode (in UTF-8)?
MIME-Version: 1.0
In-Reply-To: <201104201747.41761.vadim [...] price.ru>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <201104201747.41761.vadim [...] price.ru>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18812-1303417467-290.67615-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 348
Download (untitled) / with headers
text/plain 348b
I think the issue is simply that you fails to provide a proper Unicode string to the URI->new() constructor. You would need to Encode::decode("UTF-8", $_) the string you read from the file. $ perl -MURI -MEncode -le 'print URI->new(encode_utf8(URI->new("http://xn--b1agaxleqp7a.xn--p1ai/")->as_iri))' http://xn--adl9opab4bsg0pbbbcbmfb.xn--ai3ub/
From vadim [...] price.ru Fri Apr 22 05: 20:54 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-6.9 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-18812-1303417467-639.67615-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-67615 [...] rt.cpan.org> <201104201747.41761.vadim [...] price.ru> <rt-3.8.HEAD-18812-1303417467-639.67615-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Content-Type: Text/Plain; charset="utf-8"
Message-ID: <201104221320.43287.vadim [...] price.ru>
Organization: price.ru
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.9
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 48252241980 for <cpan-bug+uri [...] hipster.bestpractical.com>; Fri, 22 Apr 2011 05:20:54 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sGWGpLFoY8P0 for <cpan-bug+uri [...] hipster.bestpractical.com>; Fri, 22 Apr 2011 05:20:51 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 9C0AC241957 for <bug-uri [...] rt.cpan.org>; Fri, 22 Apr 2011 05:20:51 -0400 (EDT)
Received: (qmail 31580 invoked by uid 103); 22 Apr 2011 09:20:50 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 22 Apr 2011 09:20:50 -0000
Received: from ghost.com.price.ru (HELO mx2.price.ru) (81.19.75.32) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Fri, 22 Apr 2011 02:20:47 -0700
Received: from [172.16.0.2] (helo=smtp.com.price.ru) by mx2.price.ru with esmtp (Exim 4.71) (envelope-from <vadim [...] price.ru>) id 1QDCXb-0007UW-Gf for bug-uri [...] rt.cpan.org; Fri, 22 Apr 2011 13:20:43 +0400
Received: from [172.16.2.105] (helo=vadim.localnet) by smtp.com.price.ru with esmtp (Exim 4.66) (envelope-from <vadim [...] price.ru>) id 1QDCXb-0001aD-FZ for bug-uri [...] rt.cpan.org; Fri, 22 Apr 2011 13:20:43 +0400
Delivered-To: cpan-bug+uri [...] hipster.bestpractical.com
User-Agent: KMail/1.12.4 (Linux/2.6.31.14-0.8-default; KDE/4.3.5; x86_64; ; )
Subject: Re: [rt.cpan.org #67615] punycode bug
Return-Path: <vadim [...] price.ru>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+uri [...] hipster.bestpractical.com
X-RT-Mail-Extension: uri
Date: Fri, 22 Apr 2011 13:20:43 +0400
X-Spam-Level:
To: bug-uri [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Vadim Menshakov <vadim [...] price.ru>
RT-Message-ID: <rt-3.8.HEAD-18805-1303464054-1277.67615-0-0 [...] rt.cpan.org>
Content-Length: 696
Download (untitled) / with headers
text/plain 696b
You are right, it works this way: cat domain.txt | iconv -t utf8 | perl -MEncode -MURI -lne 'chomp; print URI->new(Encode::decode("utf8", $_))->canonical' http://xn--b1agaxleqp7a.xn--p1ai/ Now I see. Thank you! On Friday 22 April 2011 00:24:27 Gisle_Aas via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=67615 > > > I think the issue is simply that you fails to provide a proper Unicode string to the URI->new() constructor. You would need to Encode::decode("UTF-8", $_) the string you read from > the file. > > $ perl -MURI -MEncode -le 'print URI->new(encode_utf8(URI->new("http://xn--b1agaxleqp7a.xn--p1ai/")->as_iri))' > http://xn--adl9opab4bsg0pbbbcbmfb.xn--ai3ub/ >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.