X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Futf_incoming.t;h=baa3f2a133442e4f113832598234a6469f6564ad;hp=ff61a6bfedae526f8c6f22114170c3e0f4f095c7;hb=b0ff1be8caade25b5485bf174f0224b2066a3b8f;hpb=80ba671f681862620befead95d299c8dfc91cbaf diff --git a/t/utf_incoming.t b/t/utf_incoming.t index ff61a6b..baa3f2a 100644 --- a/t/utf_incoming.t +++ b/t/utf_incoming.t @@ -121,6 +121,7 @@ use Scalar::Util (); sub file_upload :POST Consumes(Multipart) Local { my ($self, $c) = @_; + Test::More::is $c->req->body_parameters->{'♥'}, '♥♥'; Test::More::ok my $upload = $c->req->uploads->{file}; Test::More::is $upload->charset, 'UTF-8'; @@ -481,17 +482,10 @@ SKIP: { is $c->req->body_parameters->{'arg0'}, 'helloworld', 'got helloworld value'; is $c->req->body_parameters->{'♥'}, '♥♥'; - - ok Scalar::Util::blessed($c->req->body_parameters->{'arg1'}); - ok Scalar::Util::blessed($c->req->body_parameters->{'arg2'}[0]); - ok Scalar::Util::blessed($c->req->body_parameters->{'arg2'}[1]); - ok Scalar::Util::blessed($c->req->body_parameters->{'♥♥♥'}); - - # Since the form post is COMPLEX you are expected to decode it yourself. - is Encode::decode('UTF-8', $c->req->body_parameters->{'arg1'}->raw_data), $utf8, 'decoded utf8 param'; - is Encode::decode('SHIFT_JIS', $c->req->body_parameters->{'arg2'}[0]->raw_data), $shiftjs, 'decoded shiftjis param'; - is Encode::decode('SHIFT_JIS', $c->req->body_parameters->{'arg2'}[1]->raw_data), $shiftjs, 'decoded shiftjis param'; - is Encode::decode('SHIFT_JIS', $c->req->body_parameters->{'♥♥♥'}->raw_data), $shiftjs, 'decoded shiftjis param'; + is $c->req->body_parameters->{'arg1'}, $utf8, 'decoded utf8 param'; + is $c->req->body_parameters->{'arg2'}[0], $shiftjs, 'decoded shiftjs param'; + is $c->req->body_parameters->{'arg2'}[1], $shiftjs, 'decoded shiftjs param'; + is $c->req->body_parameters->{'♥♥♥'}, $shiftjs, 'decoded shiftjs param'; }