5 use Encode 2.21 'decode_utf8';
9 package MyApp::Controller::Root;
10 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
12 use base 'Catalyst::Controller';
14 sub heart :Path('♥') {
16 $c->stash(hearts=>'♥♥♥');
17 $c->detach('View::HTML');
19 package MyApp::View::HTML;
20 $INC{'MyApp/View/HTML.pm'} = __FILE__;
22 use base 'Catalyst::View::TT';
24 MyApp::View::HTML->config(
26 INCLUDE_PATH=> File::Spec->catfile('t'));
34 use Catalyst::Test 'MyApp';
36 if(MyApp->can('encoding') and MyApp->can('clear_encoding') ) {
37 ok my $res = request '/root/♥';
38 is $res->code, 200, 'OK';
39 is decode_utf8($res->content), "<p>This heart literal ♥</p><p>This is heart var ♥♥♥</p>\n", 'correct body';
40 is $res->content_charset, 'UTF-8';
42 ok 1, 'Skipping the UTF8 Tests for older installed catalyst';