Apache-Request-I18N

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- Calling args() now produces a warning

	Enhancements:
	- It should now be possible to subclass this module
	- The Content-Type charset for x-www-form-urlencoded is now used, if
	  provided
	- Support was added for language specification in encoded words
	  (RFC 2184, section 5)

	Bugfixes:
	- Form fields in the query string are no longer decoded for
	  multipart/form-data
	- handler() now returns DECLINED instead of OK
	- instance() was ignoring any previously existing Apache::Request

0.03  Fri Nov 25 15:30:25 2005
	- Bugfix: upload(NAME) crashed if no upload by that name existed

0.02  Mon Aug  8 12:48:00 2005
	- Bugfix when erroneously supplying Apache::Request options

I18N.pm  view on Meta::CPAN

  SetHandler  perl-script
  PerlHandler Apache::Request::I18N <your other handlers ...>
  PerlSetVar  DecodeParms  utf-8
  </Location>


=head1 DESCRIPTION

I<Apache::Request::I18N> adds transparent support over I<Apache::Request> for
internationalized GET/POST parameters.  Form field names and values are
automatically decoded and converted either to Perl's internal UTF-8 format, or
to another character encoding.

Since this module inherits from I<Apache::Request>, it can be used as a
drop-in replacement.  (It is not a B<perfect> replacement, though; see
L<"COMPATIBILITY ISSUES"> below.)  It can also be used in a I<PerlHandler>
directive, in which case all subsequent handlers will -- if they play nicely
-- automatically see the converted names and values.


=head1 CONSTRUCTORS

I18N.pm  view on Meta::CPAN


sub next { carp "next() is not supported"; $_[0]->SUPER::next }


package Apache::Request::I18N;

=head1 HANDLER

This module provides a simple Apache handler that can be used in a
I<PerlHandler> directive.  This is useful when used in combination with other
handlers, which will then automatically access the decoded values.  (This
works as long as each handler takes care to call B<instance>() instead of
creating a new object.)

For example, you can use this module in combination with Mason:

  SetHandler  perl-script
  PerlHandler +Apache::Request::I18N +HTML::Mason::ApacheHandler
  PerlSetVar  DecodeParms  EUC-JP

Each Mason component will now see its arguments as true Perl character

I18N.pm  view on Meta::CPAN

=over

=item *

When using the B<multipart/form-data> encoding, the proper encoding of form
field names and filenames as specified by RFC 2184 is currently not supported.
(This is due to a limitation in I<libapreq>.)

Conversely, since some user-agents are known to encode such values via RFC
2047, we attempt decoding if possible.  This means that a value supplied by a
standard-compliant user-agent may be wrongly decoded.

=item *

When using the B<multipart/form-data> encoding, each form field value may have
its character encoding specified via the I<charset> parameter of its
I<Content-Type> header.  This value is currently ignored.  (This is due to a
limitation in I<libapreq>.)

Similarly, the I<Content-Transfer-Encoding> header is also ignored.

=item *

When using upload hooks, the upload object supplied to UPLOAD_HOOK will not
have had its I<name>() and I<filename>() decoded yet.

=item *

When using the B<multipart/form-data> encoding, this module will get confused
if a form field appears in both the query string B<and> the request body.  In
other words, don't try to do this:

  <FORM METHOD=post ENCTYPE="multipart/form-data"
  	ACTION=".../my_script?foo=1">
  <INPUT NAME="foo" ...>

README  view on Meta::CPAN

Apache-Request-I18N version 0.06
================================

This module adds transparent support over Apache::Request for
internationalized GET/POST parameters.  Form field names and values are
automatically decoded and converted either to Perl's internal UTF-8 format, or
to another character encoding.

Since this module inherits from Apache::Request, it can be used as a drop-in
replacement.  (It is not a perfect replacement, though; see the manpage for
details.)  It can also be used in a PerlHandler directive, in which case all
subsequent handlers will -- if they play nicely -- automatically see the
converted names and values.


INSTALLATION

t/dump.d/nomime_urlencoded.in  view on Meta::CPAN

# application/x-www-form-urlencoded should not be MIME-decoded
POST / HTTP/1.0
Content-Type: application/x-www-form-urlencoded

author=%3d?ISO-8859-1?Q?Fr%3dE9d%3dE9ric%3d20Bri%3dE8re?%3d&auteur=%3d?UTF-8?B?RnLDqWTDqXJpYyBCcmnDqHJl?%3d



( run in 0.586 second using v1.01-cache-2.11-cpan-26ccb49234f )