r73603 - in /trunk/libcgi-pm-perl: Changes MANIFEST META.yml debian/changelog lib/CGI.pm lib/CGI/Util.pm t/delete.t t/tmpdir.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Tue Apr 26 16:07:38 UTC 2011


Author: periapt-guest
Date: Tue Apr 26 16:07:17 2011
New Revision: 73603

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73603
Log:
New upstream release

Added:
    trunk/libcgi-pm-perl/t/delete.t
      - copied unchanged from r73602, branches/upstream/libcgi-pm-perl/current/t/delete.t
    trunk/libcgi-pm-perl/t/tmpdir.t
      - copied unchanged from r73602, branches/upstream/libcgi-pm-perl/current/t/tmpdir.t
Modified:
    trunk/libcgi-pm-perl/Changes
    trunk/libcgi-pm-perl/MANIFEST
    trunk/libcgi-pm-perl/META.yml
    trunk/libcgi-pm-perl/debian/changelog
    trunk/libcgi-pm-perl/lib/CGI.pm
    trunk/libcgi-pm-perl/lib/CGI/Util.pm

Modified: trunk/libcgi-pm-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/Changes?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/Changes (original)
+++ trunk/libcgi-pm-perl/Changes Tue Apr 26 16:07:17 2011
@@ -1,4 +1,16 @@
-Version 3.52
+Version 3.53, Apr 25, 2011
+  
+  [NEW FEATURES]
+  - The DELETE HTTP verb is now supported. 
+    (RT#52614, James Robson, Eduardo Ariño de la Rubia) 
+
+  [INTERNALS]  
+  - Correct t/tmpdir.t MANIFEST entry. (RT#64949)
+  - Update minimum required Perl version to be Perl 5.8.1, which
+    has been out since 2003. This allows us to drop some hacks
+    and exceptions (Mark Stosberg)
+
+Version 3.52, Jan 24, 2011
   
   [DOCUMENTATION]
   - The documentation for multi-line header handling was been updated to reflect
@@ -9,7 +21,7 @@
   - Fix warning in t/cookie.t (RT#64570, Chris Williams, Rainer Tammer, Mark Stosberg)     
   - Fixed logic bug in t/multipart_init.t (RT#64261, Niko Tyni)
 
-Version 3.51
+Version 3.51, Jan 5, 2011
 
   [NEW FEATURES]  
   - A new option to set $CGI::Carp::TO_BROWSER = 0, allows you to explicitly  
@@ -65,7 +77,7 @@
   - Re-fixing https test in http.t. (RT#54768, thanks to SPROUT)
   - param_fetch no longer triggers a warning when called with no arguments (ysth, Mark Stosberg)
 
-Version 3.50
+Version 3.50, Nov 8, 2010
   
   [SECURITY]
   1. The MIME boundary in multipart_init is now random. 
@@ -83,7 +95,7 @@
   1. Fixing https test in http.t. (RT#54768)
   2. Tests were added for multipart_init(). Thanks to Mark Stosberg and CGI::Simple. 
 
-Version 3.49
+Version 3.49, Feb 5th, 2010
 
   [BUG FIXES]
   1. Fix a regression since 3.44 involving a case when the header includes "Content-Length: 0". 
@@ -104,7 +116,7 @@
   1. More tests were added for autoescape, thanks to Bob Kuo. (RT#25485)
   2. Attempt to avoid test failures with t/fast, thanks to Steve Hay. (RT#49599)
 
-Version 3.48
+Version 3.48, Sep 25, 2009
 
   [BUG FIXES]
   1. <optgroup> default values are now properly escaped.
@@ -121,14 +133,15 @@
   [INTERNALS]
   1. More tests were added for autoescape, thanks to Bob Kuo. (RT#25485)
 
-Version 3.47
-  Released September 9th, 2009.
+Version 3.47,  Sep 9, 2009
+
   No code changes. 
 
   [INTERNALS]
     Re-release of 3.46, which did not contain a proper MANIFEST
 
 Version 3.46
+
   [BUG FIXES]
   1. In CGI::Pretty, we no longer add line breaks after tags we claim not to format. Thanks to rrt, Bob Kuo and
      and Mark Stosberg. (RT#42114).
@@ -181,7 +194,8 @@
   2. Automated tests for hidden() have been added, thanks to Russel Jenkins and Mark Stosberg (RT#20436)
   3. t/util.t has been updated to use Test::More instead of a home-grown test function. Thanks to Bob Kuo.
 
-Version 3.45
+Version 3.45, Aug 14, 2009
+
   [BUG FIXES]
   1. Prevent warnings about "uninitialized values" for REQUEST_URI, HTTP_USER_AGENT and other environment variables.
      Patches by Callum Gibson, heiko and Mark Stosberg. (RT#24684, RT#29065)
@@ -220,41 +234,48 @@
   4. CGI::Switch and CGI::Apache now properly set their VERSION in their own name space.
      Thanks to Alexey Tourbin (RT#11941,RT#11942)
 
-  Version 3.44
+Version 3.44, Jul 30, 2009
+
   1. Patch from Kurt Jaeger to allow HTTP PUT even if the content length is unknown.
   2. Patch from Pavel merdin to fix a problem for one of the FireFox addons.
   3. Fixed issue in mod_perl & fastCGI environment of cookies returned from
      CGI->cookie() leaking from one session to another.
 
-  Version 3.43
+Version 3.43, Apr 06, 2009
+
   1. Documentation patch from MARKSTOS at cpan.org to replace all occurrences of
   "new CGI" with CGI->new()" to reflect best perl practices.
   2. Patch from Stepan Kasal to fix utf-8 related problems in perl 5.10
 
-  Version 3.42
+Version 3.42, Sep 08, 2008
+
   1. Added patch from Renee Baecker that makes it possible to subclass
   CGI::Pretty.
   2. Added patch from Nicholas Clark to allow ~ characters in temporary directories.
   3. Added patch from Renee Baecker that fixes the inappropriate escaping of fields
      in multipart headers.
 
-  Version 3.41
+Version 3.41, Aug 25, 2008
+
   1. Fix url() returning incorrect path when query string contains escaped newline.
   2. Added additional windows temporary directories and environment variables, courtesy patch from Renee Baecker
   3. Added a handle() method to the lightweight upload
   filehandles. This method returns a real IO::Handle object.
   4. Added patch from Tony Vanlingen to fix deep recursion warnings in CGI::Pretty.
 
-  Version 3.40
+Version 3.40, Aug 06, 2008
+
   1. Fixed CGI::Fast docs to eliminate references to a "special"
   version of Perl.
   2. Makefile.PL now depends on FCGI so that CGI::Fast installs properly.
   3. Fix script_name() call from Stephane Chazelas.
 
-  Version 3.39
+Version 3.39, Jun 29, 2008
+
   1. Fixed regression in "exists" function when using tied interface to CGI via $q->Vars.
 
-  Version 3.38
+Version 3.38, Jun 25, 2008
+
   1. Fix annoying warning in http://rt.cpan.org/Ticket/Display.html?id=34551
   2. Added nobr() function http://rt.cpan.org/Ticket/Display.html?id=35377
   3. popup_menu() allows multiple items to be selected by default, satisfying
@@ -265,56 +286,68 @@
   6. Fixed minor warning described at http://rt.cpan.org/Public/Bug/Display.html?id=36435
   7. Fixed overlap of attribute and parameter space described in http://rt.perl.org/rt3//Ticket/Display.html?id=24294
 
-  Version 3.37
+Version 3.37, Apr 22, 2008
+
   1. Fix pragmas so that they persist over modperl invocations (e.g. RT 34761)
   2. Fixed handling of chunked multipart uploads; thanks to Michael Bernhardt
      who reported and fixed the problem.
 
-  Version 3.36
+Version 3.36
+
   1. Fix CGI::Cookie to support cookies that are separated by "," instead of ";".
 
-  Version 3.35
+Version 3.35, Mar 27, 2008
+
   1. Resync with bleadperl, primarily fixing a bug in parsing semicolons in uploaded filenames.
 
-  Version 3.34
+Version 3.34, Mar 18, 2008
+
   1. Handle Unicode %uXXXX  escapes properly -- patch from DANKOGAI at cpan.org
   2. Fix url() method to not choke on path names that contain regex characters.
 
-  Version 3.33
+Version 3.33, Jan 02, 2008
+
   1. Remove uninit variable warning when calling url(-relative=>1)
   2. Fix uninit variable warnings for two lc calls
   3. Fixed failure of tempfile upload due to sprintf() taint failure in perl 5.10
 
-  Version 3.32
+Version 3.32, Dec 27, 2007
+
   1. Patch from Miguel Santinho to prevent sending premature headers under mod_perl 2.0
 
-  Version 3.31
+Version 3.31, Nov 30, 2007
+
   1. Patch from Xavier Robin so that CGI::Carp issues a 500 Status code rather than a 200 status code.
   2. Patch from Alexander Klink to select correct temporary directory in OSX Leopard so that upload works.
   3. Possibly fixed "wrapped pack" error on 5.10 and higher.
 
-  Version 3.30
+Version 3.30 
+
   1. Patch from Mike Barry to handle POSTDATA in the same way as PUT.
   2. Patch from Rafael Garcia-Suarez to correctly reencode unicode values as byte values.
 
-  Version 3.29
+Version 3.29, Apr 16, 2007
+
   1. The position of file handles is now reset to zero when CGI->new is called.
     (Mark Stosberg)
   2. uploadInfo() now works across multiple object instances. Also, the first
      tests for uploadInfo() were added as part of the fix. (CPAN bug 11895, with
      contributions from drfrench and Mark Stosberg).
 
-  Version 3.28
+Version 3.28, Mar 29, 2007
+
   1. Applied patch from Allen Day that makes Cookie parsing RFC2109 compliant
 	(attribute/values can be separated by commas as well as semicolons).
   2. Applied patch from Stephan Struckmann that allows script_name() to be set correctly.
   3. Fixed problem with url(-full) in which port number appears twice.
 
-  Version 3.27
+Version 3.27, Feb 27, 2007
+
   1. Applied patch from Steve Taylor that allows checkbox_groups to be
   disabled with a new -disabled=> option.
 
-  Version 3.26
+Version 3.26
+
   1. Fixed alternate stylesheet behavior so that it is insensitive to order of declarations.
   2. Patch from John Binns to allow users to provide a callback to CGI::Carp.
   3. Added "~" as an unreserved character in escape().
@@ -322,31 +355,37 @@
   5. Fixed outdated documentation (and behavior) of -language in start_html -script option.
   6. Fixed bug in seconds calculation in CGI::Util::expire_calc.
 
-  Version 3.25
+Version 3.25, Sep 28, 2006
+
   1. Fixed the link to the Netscape frames page.
   2. Added ability to specify an alternate stylesheet.
   3. Add support for XForms POST submssion both as application/xml or as multipart/related
 
-  Version 3.24
+Version 3.24
+
   1. In startform(), if request_uri() returns undef, then falls back
   to self_url(). This should rarely happen except when run outside of
   the CGI environment.
   2. image button alignment options were mistakenly being capitalized, causing xhtml validation to fail.
 
-  Version 3.23
+Version 3.23, Aug 23, 2006
+
   1. Typo in upload() persisted, now fixed for real. Thanks to
   Emanuele Zeppieri for correct patch and regression test.
 
-  Version 3.22
+Version 3.22, Aug 23, 2006
+
   1. Typo in upload() function broke uploads. Now fixed (CPAN bug 21126).
 
-  Version 3.21
+Version 3.21, Aug 21, 2006
+
   1. Don't try to read data at all when POST > $POST_MAX.
   2. Fixed bug that caused $cgi->param('name',undef,'value') to unset param('name') entirely.
   3. Fixed bug in which upload() sometimes returns empty. (CPAN bug #12694).
   4. Incorporated patch from BURAK at cpan.org to support HTTPcookies (CPAN bug 21019).
 
-  Version 3.20
+Version 3.20
+
   1. Patch from David Wheeler for CGI::Cookie->bake(). Uses mod_perl headers_out->add()
 	rather than headers_out->set().
   2. Fixed problem identified by Andrei Voronkov in which start_form() output was screwed
@@ -354,7 +393,8 @@
   3. Quashed uninitialized variable warnings coming from script_name(), url() and other
         functions that require access to the PATH_INFO environment variable.
 
-  Version 3.19
+Version 3.19
+
   1. Added patch from Stephen Frost that allows one to suppress use of the temp file that is
 	created during uploads.
   2. Fixed problem noted by Martin Foster in which regular expression meta-character terms
@@ -363,12 +403,14 @@
   3. More fixes to the url() method.
   4. Removed "hack to fix broken PATH_INFO in MSII".
 
-  Version 3.18
+Version 3.18
+
   1.  Doc typo fixes.
   2.  Patch from Steve Peters to default the document type to match the charset.
   3.  Fixed param() so that param(-name=>'foo',-values=>[]) sets the parameter to empty list.
 
-  Version 3.17 Fri Feb 24 14:01:27 EST 2006
+Version 3.17, Feb 24, 2006
+
    1. Added patch from Mike Hanafey which caused 0 arguments to CGI::Cookie->new() to
 	be treated as empty.
    2. Patch to CGI::Carp from Peter Whaite to fix the unfixable problem of CGI::Carp
@@ -377,7 +419,8 @@
 	with another's variables.
    4. Fixed upload failure on files that contain semicolons in their names.
 
-  Version 3.16 Wed Feb  8 13:29:11 EST 2006
+Version 3.16, Feb 8, 2006
+
    1. header() -charset option now works even when the MIME type is not "text".
    2. Fixed documentation for cookie() function and fastCGI.
    3. Upload filehandles now only closed automatically on Windows systems.
@@ -388,16 +431,20 @@
 	but was "Moved".
    7. Fixed charset in start_html() and header() to be in synch.
 
-  Version 3.15 Wed Dec  7 15:13:22 EST 2005
+Version 3.15, Dec 7, 2005
+
    1. Remove extraneous "?" from self_url() when URI contains a ? but no query string.
 
-  Version 3.14 Tue Dec  6 17:12:03 EST 2005
+Version 3.14, Dec 6,  2005
+
    1. Fixed broken scrolling_list() select attribute.
 
-  Version 3.13
+Version 3.13, Dec 4, 2005
+
     1. Removed extraneous empty "?" from end of self_url().
 
-  Version 3.12
+Version 3.12, Dec 4, 2005
+
     1. Fixed virtual_port so that it works properly with https protocol.
     2. Fixed documentation for upload_hook().
     3. Added POSTDATA documentation.
@@ -414,7 +461,8 @@
     9. Fixed CGI::Carp to work correctly with Mod_perl 1.29 in an Apache 2 environment.
    10. Setting $CGI::TMPDIRECTORY should now be effective.
 
-  Version 3.11
+Version 3.11, Aug 3, 2005
+
     1. Killed warning in CGI::Cookie about MOD_PERL_API_VERSION
     2. Fixed append() so that it works in function mode.
     3. Workaround for a bug that appears in Apache2 versions through 2.0.54
@@ -424,21 +472,25 @@
        not handle the uncommon case of a ScriptAlias directive that adds additional
        path information to the end of the translated URI.
 
-  Version 3.10
+Version 3.10, May 13, 2005
+
     1. Added Apache2::RequestIO, which is necessary for mp2 interoperability.
 
-  Version 3.09
+Version 3.09, May 5, 2005
+
     1. Fixed tabindex="0" when using CGI to create forms without a prior start_html
     2. Removed warning about non-numeric MOD_PERL_API_VERSION.
 
-  Version 3.08
+Version 3.08, Apr 20, 2005
+
     1. update support for mod_perl 2.0.  versions prior to
        mod_perl 1.999_22 (2.0.0-RC5) are no longer supported.
 
-  Version 3.07
+Version 3.07, Mar 14, 2005
+
     1. Fixed typo in mod_perl detection.
 
-  Version 3.06
+Version 3.06, Mar 09, 2005
 
     1. Fixed bare call to script() in start_html
     2. Moved Fh::DESTROY out of autoloaded functions so as to avoid
@@ -467,7 +519,7 @@
 	higher perls (fix courtesy Slaven Rezic).
 
 
-  Version 3.05
+Version 3.05, Apr 12, 2004
 
     1. Fixed uninitialized variable warning on start_form() when running
        from command line.
@@ -500,23 +552,23 @@
    15. Fixed documentation bug in -style argument to start_html()
    16. Added -status argument to redirect().
 
-  Version 3.04
+Version 3.04, Jan 18, 2004
 
     1. Fixed the problem with mod_perl crashing when "defaults" button
        pressed.
 
-  Version 3.03
+Version 3.03, Jan 13, 2004
 
     1. Fix upload hook functionality
     2. Workaround for CGI->unescape_html()
     3. Bumped version numbers in CGI::Fast and CGI::Util for 5.8.3-tobe
 
-  Version 3.02
+Version 3.02
 
     1. Bring in Apache::Response just in case.
     2. File upload on EBCDIC systems now works.
 
-  Version 3.01
+Version 3.01, Dec 10, 2003
 
     1. No fix yet for upload failures when running on EBCDIC server.
     2. Fixed uninitialized glob warnings that appeared when file
@@ -539,7 +591,7 @@
    12. Added virtual_port() method for finding out what port server is
        listening on in a virtual-host aware fashion.
 
-  Version 3.00
+Version 3.00, Aug 18, 2003
 
     1. Patch from Randal Schwartz to fix bug introduced by cross-site
        scripting vulnerability "fix."

Modified: trunk/libcgi-pm-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/MANIFEST?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/MANIFEST (original)
+++ trunk/libcgi-pm-perl/MANIFEST Tue Apr 26 16:07:17 2011
@@ -41,6 +41,7 @@
 t/charset.t
 t/checkbox_group.t
 t/cookie.t
+t/delete.t
 t/Dump.t
 t/end_form.t
 t/fast.t
@@ -65,7 +66,7 @@
 t/start_end_end.t
 t/start_end_start.t
 t/switch.t
-t/tmpfile.t
+t/tmpdir.t
 t/unescapeHTML.t
 t/upload.t
 t/upload_post_text.txt

Modified: trunk/libcgi-pm-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/META.yml?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/META.yml (original)
+++ trunk/libcgi-pm-perl/META.yml Tue Apr 26 16:07:17 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               CGI.pm
-version:            3.52
+version:            3.53
 abstract:           ~
 author:  []
 license:            unknown

Modified: trunk/libcgi-pm-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/debian/changelog?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/debian/changelog (original)
+++ trunk/libcgi-pm-perl/debian/changelog Tue Apr 26 16:07:17 2011
@@ -1,8 +1,9 @@
-libcgi-pm-perl (3.52-2) UNRELEASED; urgency=low
+libcgi-pm-perl (3.53-1) UNRELEASED; urgency=low
 
   * Removed watch file hack as it no longers seems to be necessary
+  * New upstream release
 
- -- Nicholas Bamber <nicholas at periapt.co.uk>  Tue, 26 Apr 2011 17:04:44 +0100
+ -- Nicholas Bamber <nicholas at periapt.co.uk>  Tue, 26 Apr 2011 17:10:32 +0100
 
 libcgi-pm-perl (3.52-1) unstable; urgency=low
 

Modified: trunk/libcgi-pm-perl/lib/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/lib/CGI.pm?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/lib/CGI.pm (original)
+++ trunk/libcgi-pm-perl/lib/CGI.pm Tue Apr 26 16:07:17 2011
@@ -1,5 +1,5 @@
 package CGI;
-require 5.006;
+require 5.008001;
 use Carp 'croak';
 
 # See the bottom of this file for the POD documentation.  Search for the
@@ -20,7 +20,7 @@
 
 # The revision is no longer being updated since moving to git. 
 $CGI::revision = '$Id: CGI.pm,v 1.266 2009/07/30 16:32:34 lstein Exp $';
-$CGI::VERSION='3.52';
+$CGI::VERSION='3.53';
 
 # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
 # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -648,9 +648,9 @@
 	  last METHOD;
       }
 
-      # If method is GET or HEAD, fetch the query from
+      # If method is GET, HEAD or DELETE, fetch the query from
       # the environment.
-      if ($is_xforms || $meth=~/^(GET|HEAD)$/) {
+      if ($is_xforms || $meth=~/^(GET|HEAD|DELETE)$/) {
 	  if ($MOD_PERL) {
 	    $query_string = $self->r->args;
 	  } else {
@@ -4524,7 +4524,7 @@
 
      $query = CGI->new;
 
-This will parse the input (from both POST and GET methods) and store
+This will parse the input (from POST, GET and DELETE methods) and store
 it into a perl5 object called $query. 
 
 Any filehandles from file uploads will have their position reset to 

Modified: trunk/libcgi-pm-perl/lib/CGI/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-pm-perl/lib/CGI/Util.pm?rev=73603&op=diff
==============================================================================
--- trunk/libcgi-pm-perl/lib/CGI/Util.pm (original)
+++ trunk/libcgi-pm-perl/lib/CGI/Util.pm Tue Apr 26 16:07:17 2011
@@ -1,18 +1,17 @@
 package CGI::Util;
-
+require 5.008001;
 use strict;
-use vars qw($VERSION @EXPORT_OK @ISA @A2E @E2A);
 require Exporter;
- at ISA = qw(Exporter);
- at EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape 
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(rearrange rearrange_header make_attributes unescape escape 
 		expires ebcdic2ascii ascii2ebcdic);
 
-$VERSION = '3.51';
+our $VERSION = '3.53';
 
 use constant EBCDIC => "\t" ne "\011";
 
 # (ord('^') == 95) for codepage 1047 as on os390, vmesa
- at A2E = (
+our @A2E = (
    0,  1,  2,  3, 55, 45, 46, 47, 22,  5, 21, 11, 12, 13, 14, 15,
   16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
   64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,
@@ -30,7 +29,7 @@
   68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87,
  140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223
 	 );
- at E2A = (
+our @E2A = (
    0,  1,  2,  3,156,  9,134,127,151,141,142, 11, 12, 13, 14, 15,
   16, 17, 18, 19,157, 10,  8,135, 24, 25,146,143, 28, 29, 30, 31,
  128,129,130,131,132,133, 23, 27,136,137,138,139,140,  5,  6,  7,
@@ -162,47 +161,10 @@
 }
 
 sub utf8_chr {
-        my $c = shift(@_);
-	if ($] >= 5.006){
-	    require utf8;
-	    my $u = chr($c);
-	    utf8::encode($u); # drop utf8 flag
-	    return $u;
-	}
-        if ($c < 0x80) {
-                return sprintf("%c", $c);
-        } elsif ($c < 0x800) {
-                return sprintf("%c%c", 0xc0 | ($c >> 6), 0x80 | ($c & 0x3f));
-        } elsif ($c < 0x10000) {
-                return sprintf("%c%c%c",
-                                           0xe0 |  ($c >> 12),
-                                           0x80 | (($c >>  6) & 0x3f),
-                                           0x80 | ( $c          & 0x3f));
-        } elsif ($c < 0x200000) {
-                return sprintf("%c%c%c%c",
-                                           0xf0 |  ($c >> 18),
-                                           0x80 | (($c >> 12) & 0x3f),
-                                           0x80 | (($c >>  6) & 0x3f),
-                                           0x80 | ( $c          & 0x3f));
-        } elsif ($c < 0x4000000) {
-                return sprintf("%c%c%c%c%c",
-                                           0xf8 |  ($c >> 24),
-                                           0x80 | (($c >> 18) & 0x3f),
-                                           0x80 | (($c >> 12) & 0x3f),
-                                           0x80 | (($c >>  6) & 0x3f),
-                                           0x80 | ( $c          & 0x3f));
-
-        } elsif ($c < 0x80000000) {
-                return sprintf("%c%c%c%c%c%c",
-                                           0xfc |  ($c >> 30),
-                                           0x80 | (($c >> 24) & 0x3f),
-                                           0x80 | (($c >> 18) & 0x3f),
-                                           0x80 | (($c >> 12) & 0x3f),
-                                           0x80 | (($c >> 6)  & 0x3f),
-                                           0x80 | ( $c          & 0x3f));
-        } else {
-                return utf8_chr(0xfffd);
-        }
+    my $c = shift(@_);
+    my $u = chr($c);
+    utf8::encode($u); # drop utf8 flag
+    return $u;
 }
 
 # unescape URL-encoded data
@@ -236,7 +198,7 @@
 # We cannot use the %u escapes, they were rejected by W3C, so the official
 # way is %XX-escaped utf-8 encoding.
 # Naturally, Unicode strings have to be converted to their utf-8 byte
-# representation.  (No action is required on 5.6.)
+# representation. 
 # Byte strings were traditionally used directly as a sequence of octets.
 # This worked if they actually represented binary data (i.e. in CGI::Compress).
 # This also worked if these byte strings were actually utf-8 encoded; e.g.,
@@ -245,39 +207,13 @@
 # was always so and cannot be fixed without breaking the binary data case.
 # -- Stepan Kasal <skasal at redhat.com>
 #
-if ($] == 5.008) {
-   package utf8;
-
-   no warnings 'redefine'; # needed for Perl 5.8.1+
-
-   my $is_utf8_redefinition = <<'EOR';
-      sub is_utf8 {
-         my ($text) = @_;
-
-         my $ctext = pack q{C0a*}, $text;
-
-         return ($text ne $ctext) && ($ctext =~ m/^(
-          [\x09\x0A\x0D\x20-\x7E]
-          | [\xC2-\xDF][\x80-\xBF]
-          | \xE0[\xA0-\xBF][\x80-\xBF]
-          | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}
-          | \xED[\x80-\x9F][\x80-\xBF]
-          | \xF0[\x90-\xBF][\x80-\xBF]{2}
-          | [\xF1-\xF3][\x80-\xBF]{3}
-          | \xF4[\x80-\x8F][\x80-\xBF]{2}
-          )*$/xo);
-      }
-EOR
-
-   eval $is_utf8_redefinition;
-}
 
 sub escape {
   # If we being called in an OO-context, discard the first argument.
   shift() if @_ > 1 and ( ref($_[0]) || (defined $_[1] && $_[0] eq $CGI::DefaultClass));
   my $toencode = shift;
   return undef unless defined($toencode);
-  utf8::encode($toencode) if ($] >= 5.008 && utf8::is_utf8($toencode));
+  utf8::encode($toencode) if utf8::is_utf8($toencode);
     if (EBCDIC) {
       $toencode=~s/([^a-zA-Z0-9_.~-])/uc sprintf("%%%02x",$E2A[ord($1)])/eg;
     } else {




More information about the Pkg-perl-cvs-commits mailing list