X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=trunk%2Ft%2Flib%2FTestAppEncoding%2FController%2FRoot.pm;fp=trunk%2Ft%2Flib%2FTestAppEncoding%2FController%2FRoot.pm;h=b5b3eeb7bd004844e9beed176a1142edf0bd2a1b;hb=e28a6876ad3e11890226e5bab6df4b0725e0981e;hp=0000000000000000000000000000000000000000;hpb=21c94d83082b43028cafcfb18659090b13d832fa;p=catagits%2FCatalyst-Runtime.git diff --git a/trunk/t/lib/TestAppEncoding/Controller/Root.pm b/trunk/t/lib/TestAppEncoding/Controller/Root.pm new file mode 100644 index 0000000..b5b3eeb --- /dev/null +++ b/trunk/t/lib/TestAppEncoding/Controller/Root.pm @@ -0,0 +1,27 @@ +package TestAppEncoding::Controller::Root; +use strict; +use warnings; +use base 'Catalyst::Controller'; +use Test::More; + +__PACKAGE__->config->{namespace} = ''; + +sub binary : Local { + my ($self, $c) = @_; + $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; local $/ = undef; <$fh>; }); +} + +sub binary_utf8 : Local { + my ($self, $c) = @_; + $c->forward('binary'); + my $str = $c->res->body; + utf8::upgrade($str); + ok utf8::is_utf8($str), 'Body is variable width encoded string'; + $c->res->body($str); +} + +sub end : Private { + my ($self,$c) = @_; +} + +1;