Catalyst::Plugin::Unicode::Encoding - Unicode aware Catalyst
use Catalyst qw[Unicode::Encoding]; MyApp->config( encoding => 'UTF-8' ); # A valid Encode encoding
On request, decodes all params from encoding into a sequence of logical characters. On response, encodes body into encoding.
Returns an instance of an Encode encoding
Encode
print $c->encoding->name
Encodes body into encoding.
Decodes parameters, query_parameters, body_parameters and filenames in file uploads into a sequence of logical characters.
Decodes request arguments (i.e. $c->request->arguments) and captures (i.e. $c->request->captures).
$c->request->arguments
$c->request->captures
Setups $c->encoding with encoding specified in $c->config->{encoding}.
$c->encoding
$c->config->{encoding}
Method called when decoding process for a request fails.
An $exception_context hashref is provided to allow you to override the behaviour of your application when given data with incorrect encodings.
$exception_context
The default method throws exceptions in the case of invalid request parameters (resulting in a 500 error), but ignores errors in upload filenames.
The keys passed in the $exception_context hash are:
The value which was not able to be decoded.
The exception recieved from Encode.
What type of data was being decoded. Valid values are (currently) params - for request parameters / arguments / captures and uploads - for request upload filenames.
params
uploads
Encode, Encode::Encoding, Catalyst::Plugin::Unicode, Catalyst.
Christian Hansen, ch@ngmedia.com
ch@ngmedia.com
Masahiro Chiba
Tomas Doran, bobtfish@bobtfish.net
bobtfish@bobtfish.net
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
To install Catalyst::Plugin::Unicode::Encoding, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Unicode::Encoding
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Unicode::Encoding
For more information on module installation, please visit the detailed CPAN module installation guide.