5 use Encode 2.21 'decode_utf8', 'encode_utf8';
6 use HTTP::Request::Common;
10 package MyApp::Controller::Root;
11 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
13 use base 'Catalyst::Controller';
15 sub heart :Path('♥') {
17 $c->stash(hearts=>'♥♥♥');
18 $c->detach('View::HTML');
20 package MyApp::View::HTML;
21 $INC{'MyApp/View/HTML.pm'} = __FILE__;
23 use base 'Catalyst::View::TT';
25 MyApp::View::HTML->config(
27 INCLUDE_PATH=> File::Spec->catfile('t'));
35 use Catalyst::Test 'MyApp';
37 if(MyApp->can('encoding') and MyApp->can('clear_encoding') ) {
38 ok my $res = request GET '/root/♥', 'Accept-Encoding' => 'gzip';
40 is $res->code, 200, 'OK';
42 is decode_utf8($res->content), "<p>This heart literal ♥</p><p>This is heart var ♥♥♥</p>\n", 'correct body';
43 is $res->content_charset, 'UTF-8';
45 ok 1, 'Skipping the UTF8 Tests for older installed catalyst';