summaryrefslogtreecommitdiff
path: root/lib/CGI
diff options
context:
space:
mode:
authorMarc Lehmann <pcg@goof.com>2007-04-12 10:41:53 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-05-10 12:41:08 +0000
commit1651fc447620d3610b694c35696c13530282f981 (patch)
tree482a8b5110d6232c00a8ca636cbf9cec7e723652 /lib/CGI
parentad91da88822a061453a454578ec2246dd493ffdd (diff)
downloadperl-1651fc447620d3610b694c35696c13530282f981.tar.gz
Re: Compress::Zlib, pack "C" and utf-8 [PATCH]
Message-ID: <20070412064153.GA22475@schmorp.de> p4raw-id: //depot/perl@31194
Diffstat (limited to 'lib/CGI')
-rw-r--r--lib/CGI/Util.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CGI/Util.pm b/lib/CGI/Util.pm
index 9cef416b96..0cb6e51a61 100644
--- a/lib/CGI/Util.pm
+++ b/lib/CGI/Util.pm
@@ -200,8 +200,8 @@ sub escape {
shift() if @_ > 1 and ( ref($_[0]) || (defined $_[1] && $_[0] eq $CGI::DefaultClass));
my $toencode = shift;
return undef unless defined($toencode);
- # force bytes while preserving backward compatibility -- dankogai
- $toencode = pack("C*", unpack("C*", $toencode));
+ # we enforce UTF-8 encoding for URLs for no good reason except UTF-8 being the future
+ utf8::encode $toencode;
if ($EBCDIC) {
$toencode=~s/([^a-zA-Z0-9_.~-])/uc sprintf("%%%02x",$E2A[ord($1)])/eg;
} else {