X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FCatty%2FController%2FRoot.pm;h=17498fd62c4017d222b299aaa1886223649f7fa3;hb=182c043a06d347ba87a5a5de87f8c33de8e3b5fd;hp=4d74605ccc758c43f4f623839d3f9de90d35c29c;hpb=127272a78225898ecf6932cb9245d1637b2c20e3;p=catagits%2FTest-WWW-Mechanize-Catalyst.git diff --git a/t/lib/Catty/Controller/Root.pm b/t/lib/Catty/Controller/Root.pm index 4d74605..17498fd 100644 --- a/t/lib/Catty/Controller/Root.pm +++ b/t/lib/Catty/Controller/Root.pm @@ -2,12 +2,12 @@ package Catty::Controller::Root; use strict; use warnings; - use base qw/ Catalyst::Controller /; use Cwd; use MIME::Base64; use Encode (); +use utf8; __PACKAGE__->config( namespace => '' ); @@ -121,7 +121,7 @@ sub gzipped : Global { # control both ends, so just always gzip the response. require Compress::Zlib; - my $html = html( "Hello", "Hi there! ☺" ); + my $html = Encode::encode('UTF-8', html( "Hello", "Hi there! ☺" )); $c->response->content_type("text/html; charset=utf-8"); $c->response->output( Compress::Zlib::memGzip($html) ); $c->response->content_encoding('gzip'); @@ -144,5 +144,12 @@ sub bad_content_encoding :Global { $c->res->body('foo'); } +sub redirect_to_utf8_upgraded_string : Global { + my($self, $c) = @_; + my $where = $c->uri_for('hello', 'müller')->as_string; + utf8::upgrade($where); + $c->res->redirect($where); +} + 1;