8 package MyApp::Controller::Root;
9 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
11 use base 'Catalyst::Controller';
13 sub heart :Path('♥') {
15 $c->stash(hearts=>'♥♥♥');
16 $c->detach('View::HTML');
18 package MyApp::View::HTML;
19 $INC{'MyApp/View/HTML.pm'} = __FILE__;
21 use base 'Catalyst::View::TT';
23 MyApp::View::HTML->config(
25 INCLUDE_PATH=> File::Spec->catfile('t'));
33 use Catalyst::Test 'MyApp';
35 if(MyApp->can('encoding') and MyApp->can('clear_encoding') ) {
36 ok my $res = request '/root/♥';
37 is $res->code, 200, 'OK';
38 is $res->decoded_content, "<p>This heart literal ♥</p><p>This is heart var ♥♥♥</p>\n", 'correct body';
39 is $res->content_charset, 'UTF-8';
41 ok 1, 'Skipping the UTF8 Tests for older installed catalyst';