Commit | Line | Data |
5ab21903 |
1 | package TestAppEncoding::Controller::Root; |
2 | use strict; |
3 | use warnings; |
4 | use base 'Catalyst::Controller'; |
5 | use Test::More; |
6 | |
7 | __PACKAGE__->config->{namespace} = ''; |
8 | |
9 | sub binary : Local { |
10 | my ($self, $c) = @_; |
b42b9094 |
11 | $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; binmode($fh); local $/ = undef; <$fh>; }); |
5ab21903 |
12 | } |
13 | |
14 | sub binary_utf8 : Local { |
15 | my ($self, $c) = @_; |
16 | $c->forward('binary'); |
17 | my $str = $c->res->body; |
18 | utf8::upgrade($str); |
19 | ok utf8::is_utf8($str), 'Body is variable width encoded string'; |
20 | $c->res->body($str); |
21 | } |
22 | |
23 | sub end : Private { |
24 | my ($self,$c) = @_; |
25 | } |
26 | |
27 | 1; |