X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestAppEncoding%2FController%2FRoot.pm;fp=t%2Flib%2FTestAppEncoding%2FController%2FRoot.pm;h=a8987fb8719023d262ed8a4924983a12f9da3f88;hp=095f238e22b84098dbb1a7fe980c62703401e03b;hb=d9669e44bfc7fb3b6e6ed662c422a60a41c74458;hpb=efcb1ae7c31fbef6407421c9e0835acfdeb82af8 diff --git a/t/lib/TestAppEncoding/Controller/Root.pm b/t/lib/TestAppEncoding/Controller/Root.pm index 095f238..a8987fb 100644 --- a/t/lib/TestAppEncoding/Controller/Root.pm +++ b/t/lib/TestAppEncoding/Controller/Root.pm @@ -24,6 +24,23 @@ sub binary_utf8 : Local { $c->res->body($str); } +# called by t/aggregate/catalyst_test_utf8.t +sub utf8_non_ascii_content : Local { + use utf8; + my ($self, $c) = @_; + + my $str = 'ʇsʎlɐʇɐɔ'; # 'catalyst' flipped at http://www.revfad.com/flip.html + ok utf8::is_utf8($str), '$str is in UTF8 internally'; + + # encode $str into a sequence of octets and turn off the UTF-8 flag, so that + # we don't get the 'Wide character in syswrite' error in Catalyst::Engine + utf8::encode($str); + ok !utf8::is_utf8($str), '$str is a sequence of octets (byte string)'; + + $c->res->body($str); +} + + sub end : Private { my ($self,$c) = @_; }