From: Marcus Ramberg <mramberg@cpan.org>
Date: Sun, 14 Nov 2004 22:13:04 +0000 (+0000)
Subject: Applied length patch for utf8.
X-Git-Tag: 2.10~83
X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=6438c73c6e11a516bfb670397bfc57048ac94c44;p=maypole.git

Applied length patch for utf8.


git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@281 48953598-375a-da11-a14b-00016c27c3ee
---

diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm
index 0f91e9a..645c046 100644
--- a/lib/Apache/MVC.pm
+++ b/lib/Apache/MVC.pm
@@ -47,7 +47,7 @@ sub send_output {
         ? $r->{content_type} . "; charset=" . $r->{document_encoding}
         : $r->{content_type}
     );
-    $r->{ar}->headers_out->set( "Content-Length" => length $r->{output} );
+    $r->{ar}->headers_out->set( "Content-Length" => do { use bytes; length $r->{output} } );
     APACHE2 || $r->{ar}->send_http_header;
     $r->{ar}->print( $r->{output} );
 }
diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm
index 345b68e..ddcf222 100644
--- a/lib/CGI/Maypole.pm
+++ b/lib/CGI/Maypole.pm
@@ -43,7 +43,7 @@ sub send_output {
     print $r->{cgi}->header(
         -type           => $r->{content_type},
         -charset        => $r->{document_encoding},
-        -content_length => length $r->{output},
+        -content_length => do { use bytes; length $r->{output} }, 
     );
     print $r->{output};
 }