r62520 - in /branches/upstream/libhttp-server-simple-mason-perl/current: Changes Makefile.PL lib/HTTP/Server/Simple/Mason.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Mon Sep 13 11:24:41 UTC 2010


Author: angelabad-guest
Date: Mon Sep 13 11:24:15 2010
New Revision: 62520

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62520
Log:
[svn-upgrade] new version libhttp-server-simple-mason-perl (0.14)

Modified:
    branches/upstream/libhttp-server-simple-mason-perl/current/Changes
    branches/upstream/libhttp-server-simple-mason-perl/current/Makefile.PL
    branches/upstream/libhttp-server-simple-mason-perl/current/lib/HTTP/Server/Simple/Mason.pm

Modified: branches/upstream/libhttp-server-simple-mason-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-mason-perl/current/Changes?rev=62520&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-mason-perl/current/Changes (original)
+++ branches/upstream/libhttp-server-simple-mason-perl/current/Changes Mon Sep 13 11:24:15 2010
@@ -1,3 +1,7 @@
+0.14 Sun Sep  5 09:24:13 EDT 2010
+
+    * encode out string only if the string is in utf8
+
 0.13 Fri Oct  9 15:01:07 EDT 2009
 
     * Better cleanup temp files after tests

Modified: branches/upstream/libhttp-server-simple-mason-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-mason-perl/current/Makefile.PL?rev=62520&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-mason-perl/current/Makefile.PL (original)
+++ branches/upstream/libhttp-server-simple-mason-perl/current/Makefile.PL Mon Sep 13 11:24:15 2010
@@ -5,9 +5,10 @@
 author('Jesse Vincent <jesse at bestpractical.com>');
 license('perl');
 abstract('A simple mason server');
-requires( HTTP::Server::Simple => 0.04,
-          HTML::Mason => 1.25,
-          Hook::LexWrap => 0
-      );
+requires(
+    'HTTP::Server::Simple' => 0.04,
+    'HTML::Mason'          => 1.25,
+    'Hook::LexWrap'        => 0,
+);
 
 &WriteAll;

Modified: branches/upstream/libhttp-server-simple-mason-perl/current/lib/HTTP/Server/Simple/Mason.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-mason-perl/current/lib/HTTP/Server/Simple/Mason.pm?rev=62520&op=diff
==============================================================================
--- branches/upstream/libhttp-server-simple-mason-perl/current/lib/HTTP/Server/Simple/Mason.pm (original)
+++ branches/upstream/libhttp-server-simple-mason-perl/current/lib/HTTP/Server/Simple/Mason.pm Mon Sep 13 11:24:15 2010
@@ -1,7 +1,7 @@
 package HTTP::Server::Simple::Mason;
 use base qw/HTTP::Server::Simple::CGI/;
 use strict;
-our $VERSION = '0.13';
+our $VERSION = '0.14';
 
 =head1 NAME
 
@@ -202,15 +202,26 @@
             $r->content_type('text/html; charset=utf-8')
                 unless $r->content_type;
 
-            if ($r->content_type =~ /charset=([\w-]+)$/ ) {
+            if ( $r->content_type =~ /charset=([\w-]+)$/ ) {
                 my $enc = $1;
-                if (lc($enc) =~ /^utf-?8$/) {
-                    binmode *STDOUT, ':utf8'; # faster than :encoding
-                }
-                else {
-                    binmode *STDOUT, ":encoding($enc)";
+                if ( lc $enc !~ /utf-?8$/ ) {
+                    for my $str (@_) {
+                        next unless $str;
+
+                        # only encode perl internal strings
+                        next unless utf8::is_utf8($str);
+                        $str = Encode::encode( $enc, $str );
+                    }
                 }
             }
+
+            # default to utf8 encoding
+            for my $str (@_) {
+                next unless $str;
+                next unless utf8::is_utf8($str);
+                $str = Encode::encode( 'utf8', $str );
+            }
+
             # We could perhaps install a new, faster out_method here that
             # wouldn't have to keep checking whether headers have been
             # sent and what the $r->method is.  That would require




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