use strict;
use warnings;
-
use base qw/ Catalyst::Controller /;
use Cwd;
use MIME::Base64;
use Encode ();
+use utf8;
__PACKAGE__->config( namespace => '' );
my $html = html( "Hello", "Hi there! $str" );
$context->response->content_type("text/html; charset=utf-8");
$context->response->output($html);
+
+ # Newer Catalyst auto encodes UTF8, but this test case is borked and expects
+ # broken utf8 behavior. We'll make a real UTF8 Test case separately.
+ $context->clear_encoding if $context->can('clear_encoding'); # Compat with upcoming Catalyst 5.90080
}
# absolute redirect
# 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');
$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;