From: Wallace Reis Date: Fri, 24 May 2013 00:19:57 +0000 (+0200) Subject: Unicode plugin - move docs to main X-Git-Tag: 5.90040~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=1d4df70b12006c9803f80e46d435a1f2610b75f1 Unicode plugin - move docs to main Just a basic copy/paste from plugin docs. Requires some polishments later. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 3e6a56e..0dd64a0 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -3187,6 +3187,10 @@ C<< $c->request->base >> will be incorrect. C - See L. +=item * + +C - See L + =back =head1 INTERNAL ACTIONS @@ -3278,6 +3282,53 @@ If you plan to operate in a threaded environment, remember that all other modules you are using must also be thread-safe. Some modules, most notably L, are not thread-safe. +=head1 ENCODING + +On request, decodes all params from encoding into a sequence of +logical characters. On response, encodes body into encoding. + +=head2 Methods + +=over 4 + +=item encoding + +Returns an instance of an C encoding + + print $c->encoding->name + +=item handle_unicode_encoding_exception ($exception_context) + +Method called when decoding process for a request fails. + +An C<$exception_context> hashref is provided to allow you to override the +behaviour of your application when given data with incorrect encodings. + +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 C<$exception_context> hash are: + +=over + +=item param_value + +The value which was not able to be decoded. + +=item error_msg + +The exception received from L. + +=item encoding_step + +What type of data was being decoded. Valid values are (currently) +C - for request parameters / arguments / captures +and C - for request upload filenames. + +=back + +=back + =head1 SUPPORT IRC: diff --git a/lib/Catalyst/Plugin/Unicode/Encoding.pm b/lib/Catalyst/Plugin/Unicode/Encoding.pm index 63b0c4a..ffcdfae 100644 --- a/lib/Catalyst/Plugin/Unicode/Encoding.pm +++ b/lib/Catalyst/Plugin/Unicode/Encoding.pm @@ -185,97 +185,24 @@ Catalyst::Plugin::Unicode::Encoding - Unicode aware Catalyst =head1 SYNOPSIS - use Catalyst qw[Unicode::Encoding]; + use Catalyst; MyApp->config( encoding => 'UTF-8' ); # A valid Encode encoding =head1 DESCRIPTION -On request, decodes all params from encoding into a sequence of -logical characters. On response, encodes body into encoding. - -=head1 METHODS - -=over 4 - -=item encoding - -Returns an instance of an C encoding - - print $c->encoding->name - -=back - -=head1 OVERLOADED METHODS - -=over - -=item finalize_headers - -Encodes body into encoding. - -=item prepare_uploads - -Decodes parameters, query_parameters, body_parameters and filenames -in file uploads into a sequence of logical characters. - -=item prepare_action - -Decodes request arguments (i.e. C<< $c->request->arguments >>) and -captures (i.e. C<< $c->request->captures >>). - -=item setup - -Setups C<< $c->encoding >> with encoding specified in C<< $c->config->{encoding} >>. - -=item handle_unicode_encoding_exception ($exception_context) - -Method called when decoding process for a request fails. - -An C<$exception_context> hashref is provided to allow you to override the -behaviour of your application when given data with incorrect encodings. - -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 C<$exception_context> hash are: - -=over - -=item param_value - -The value which was not able to be decoded. - -=item error_msg - -The exception received from L. - -=item encoding_step - -What type of data was being decoded. Valid values are (currently) -C - for request parameters / arguments / captures -and C - for request upload filenames. - -=back - -=back - -=head1 SEE ALSO - -L, L, L, L. +This plugin is automatically loaded by apps. Even though is not a core component +yet, it will vanish as soon as the code is fully integrated. For more +information, please refer to C section at L. =head1 AUTHORS -Christian Hansen, C - -Masahiro Chiba - -Tomas Doran, C +Catalyst Contributors, see Catalyst.pm -=head1 LICENSE +=head1 COPYRIGHT -This library is free software . You can redistribute it and/or modify -it under the same terms as perl itself. +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. =cut diff --git a/t/author/podcoverage.t b/t/author/podcoverage.t index bee250c..894f122 100644 --- a/t/author/podcoverage.t +++ b/t/author/podcoverage.t @@ -8,6 +8,7 @@ use Test::Pod::Coverage 1.04; my @modules = all_modules; our @private = ( 'BUILD' ); foreach my $module (@modules) { + next if $module =~ /Unicode::Encoding/; local @private = (@private, 'run', 'dont_close_all_files') if $module =~ /^Catalyst::Script::/; local @private = (@private, 'plugin') if $module =~ /^Catalyst$/; local @private = (@private, 'snippets') if $module =~ /^Catalyst::Request$/;