Skip to content

Commit

Permalink
Add supplementary documents.
Browse files Browse the repository at this point in the history
  • Loading branch information
moznion committed Sep 25, 2013
1 parent 7049966 commit 8568d92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ Plack::Request::WithEncoding - Subclass of [Plack::Request](http://search.cpan.o
# };

my $req = Plack::Request::WithEncoding->new($env);

$req->env->{'plack.request.withencoding.encoding'} = 'cp932'; # <= specify the encoding method.

# If `$req->env->{'plack.request.withencoding.encoding'}` is undef (namely, the encoding method is not specified),
# then this library will use `utf-8` as encoding method.

my $query = $req->param('query'); # <= get parameters of 'query' that is decoded by 'cp932'.

my $res = $req->new_response(200); # new Plack::Response
Expand Down
4 changes: 4 additions & 0 deletions lib/Plack/Request/WithEncoding.pm
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ Plack::Request::WithEncoding - Subclass of L<Plack::Request> which supports enco
# };
my $req = Plack::Request::WithEncoding->new($env);
$req->env->{'plack.request.withencoding.encoding'} = 'cp932'; # <= specify the encoding method.
# If `$req->env->{'plack.request.withencoding.encoding'}` is undef (namely, the encoding method is not specified),
# then this library will use `utf-8` as encoding method.
my $query = $req->param('query'); # <= get parameters of 'query' that is decoded by 'cp932'.
my $res = $req->new_response(200); # new Plack::Response
Expand Down

0 comments on commit 8568d92

Please sign in to comment.