Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 27104
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: md [...] bts.sk
Cc:
AdminCc:

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



MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DKIM_POLICY_SIGNSOME,DK_POLICY_SIGNSOME,SPF_PASS
Content-Disposition: inline
Received-SPF: pass (x1.develooper.com: local policy)
X-Virus-Scanned: ClamAV 0.88.7/3229/Sat May 12 07:59:29 2007 on us.svf.stuba.sk
Content-Type: multipart/mixed; boundary="45Z9DzgjV8m4Oswq"
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 9EA774D806E for <bug-CGI.pm [...] rt.cpan.org>; Sat, 12 May 2007 08:32:29 -0400 (EDT)
Received: (qmail 24551 invoked by alias); 12 May 2007 12:32:28 -0000
Received: from us.svf.stuba.sk (HELO us.svf.stuba.sk) (147.175.16.9) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 12 May 2007 05:27:26 -0700
Received: from us.svf.stuba.sk (localhost [127.0.0.1]) by us.svf.stuba.sk (8.13.8/8.13.8) with ESMTP id l4CCRGFm020553; Sat, 12 May 2007 14:27:16 +0200 (CEST) (envelope-from md [...] us.svf.stuba.sk)
Received: (from md [...] localhost) by us.svf.stuba.sk (8.13.8/8.13.8/Submit) id l4CCRBcq020552; Sat, 12 May 2007 14:27:11 +0200 (CEST) (envelope-from md)
Delivered-To: cpan-bug+cgi.pm [...] diesel.bestpractical.com
Subject: param not working with UTF-8
User-Agent: Mutt/1.4.2.2i
Return-Path: <md [...] svf.stuba.sk>
X-Original-To: bug-CGI.pm [...] rt.cpan.org
X-Spam-Check-BY: la.mx.develooper.com
X-Old-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00, SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.1.7
Date: Sat, 12 May 2007 14:27:11 +0200
X-Virus-Status: Clean
X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on us.svf.stuba.sk
Message-Id: <20070512122711.GA20433 [...] us.svf.stuba.sk>
To: bug-CGI.pm [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: Marian Ďurkovič <md [...] bts.sk>
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-RT-Original-Encoding: utf-8
Content-Length: 1332
Download (untitled) / with headers
text/plain 1.3k
Hi, seems that due to bugreport #19913 a new code was introduced into param, which automatically calls decode if UTF-8 is being used. However this has bad conseqeunces and breaks some applications - like openwebmail. The problem is, that lot of perl fucntions don't accept wide characters (md5, zlib, etc). While the original UTF-8 string passes through them fine, after decode they all complain with e.g. Wide character in subroutine entry at /usr/lib/perl5/site_perl/5.8.8/IO/Compress/Adapter/Deflate.pm line 43 The attached patch against CGI.pm v3.25 solves the problem and makes e.g. openwebmail work again. With kind regards, M. -------------------------------------------------------------------------- ---- ---- Show quoted text
---- Marian Ďurkovič network manager ---- ---- ---- ---- Slovak Technical University Tel: +421 2 524 51 301 ---- ---- Computer Centre, Nám. Slobody 17 Fax: +421 2 524 94 351 ---- ---- 812 43 Bratislava, Slovak Republic E-mail/sip: md@bts.sk ---- ---- ---- --------------------------------------------------------------------------
Content-Type: text/plain; charset=utf-8
content-disposition: attachment; filename="CGI.diff"
X-RT-Original-Encoding: utf-8
Content-Length: 557
Download CGI.diff
text/x-diff 557b

Message body is not shown because sender requested not to inline it.

MIME-Version: 1.0
In-Reply-To: <20070512122711.GA20433 [...] us.svf.stuba.sk>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-29071-1181091304-1906.27104-0-0 [...] rt.cpan.org>
References: <20070512122711.GA20433 [...] us.svf.stuba.sk>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 487
Download (untitled) / with headers
text/plain 487b
A related issue: it seems that if cgi's charset is set to utf-8, then character retrieved with param() are converted to UTF8, but when they're set in they're not converted back. This program shows the behavior: #!/usr/bin/perl -w use strict; use CGI; use utf8; my $cgi = new CGI(); $cgi->charset( "utf-8" ); $cgi->param("euro", "â¬" ); # option-shift 2 on a mac, the euro symbol. my $euro = $cgi->param("euro"); print "Euro: $euro\n"; $cgi->param("euro", $euro);
MIME-Version: 1.0
In-Reply-To: <20070512122711.GA20433 [...] us.svf.stuba.sk>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-29072-1181091445-855.27104-0-0 [...] rt.cpan.org>
References: <20070512122711.GA20433 [...] us.svf.stuba.sk>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 660
Download (untitled) / with headers
text/plain 660b
A related issue: it seems that if CGI's charset is set to utf-8, then characters retrieved with param() are converted to UTF8, but when they're put back they're not converted back from UTF8 into a bytestring. This program shows the behavior: #!/usr/bin/perl -w use strict; use CGI; use utf8; my $cgi = new CGI(); $cgi->charset( "utf-8" ); $cgi->param("euro", "â¬" ); # option-shift 2 on a mac, the euro symbol. # (not sure right char is above, but that's the char I discovered the # issue with in my system) my $euro = $cgi->param("euro"); print "Euro: $euro\n"; $cgi->param("euro", $euro); # this line causes the wide char error
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-29072-1181091445-855.27104-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <20070512122711.GA20433 [...] us.svf.stuba.sk> <rt-3.6.HEAD-29072-1181091445-855.27104-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-6413-1248480971-1226.27104-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 848
Download (untitled) / with headers
text/plain 848b
On Tue Jun 05 20:57:25 2007, JOSHR wrote: Show quoted text
> A related issue: > > it seems that if CGI's charset is set to utf-8, then characters > retrieved with param() are converted to UTF8, but when they're put back > they're not converted back from UTF8 into a bytestring. This program > shows the behavior: > > #!/usr/bin/perl -w > use strict; > > use CGI; > use utf8; > my $cgi = new CGI(); > $cgi->charset( "utf-8" ); > $cgi->param("euro", "â¬" ); > # option-shift 2 on a mac, the euro symbol. > # (not sure right char is above, but that's the char I discovered the > # issue with in my system) > > my $euro = $cgi->param("euro"); > > print "Euro: $euro\n"; > > $cgi->param("euro", $euro); # this line causes the wide char error
This appears to be resolved by CGI.pm 3.43. The above test script no longer triggers an error.


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.