1 package TestAppEncoding::Controller::Root;
4 use base 'Catalyst::Controller';
7 __PACKAGE__->config->{namespace} = '';
12 open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!;
14 local $/ = undef; <$fh>;
18 sub binary_utf8 : Local {
20 $c->forward('binary');
21 my $str = $c->res->body;
23 ok utf8::is_utf8($str), 'Body is variable width encoded string';
27 # called by t/aggregate/catalyst_test_utf8.t
28 sub utf8_non_ascii_content : Local {
32 my $str = 'ʇsʎlɐʇɐɔ'; # 'catalyst' flipped at http://www.revfad.com/flip.html
33 ok utf8::is_utf8($str), '$str is in UTF8 internally';
35 # encode $str into a sequence of octets and turn off the UTF-8 flag, so that
36 # we don't get the 'Wide character in syswrite' error in Catalyst::Engine
38 ok !utf8::is_utf8($str), '$str is a sequence of octets (byte string)';