Egg::Plugin::Charset - Base class for Charset plugin.
use Egg qw/ Charset::UTF8 /;
This module is a base class for the following subclasses.
Egg::Plugin::Charset::UTF8
Egg::Plugin::Charset::EUC_JP
Egg::Plugin::Charset::Shift_JIS
This module does interrupt to '_output'. And, the character-code of contents set in $e->response->body is changed.
The module with this method of '_convert_body' is made to make the subclass by oneself, and processing that converts the character-code in this method is written.
package Egg::Plugin::Charset::AnyCode; use strict; use ConvertAny; sub _setup { my($e)= @_; $e->config->{content_language}= 'ja'; $e->config->{charset_out}= "AnyCode"; $e->next::method; } sub _convert_body { my $e = shift; my $body = shift || return 0; $$body= ConvertAny->convert($body); # $body is SCALAR reference. }
I think that it doesn't want to process this plug-in at times.
The processing of this plugin can temporarily be canceled for this case by setting an effective value to $e->no_convert.
$e->no_convert(1);
The contents sources to be converted are returned.
Undefined is returned when $e->no_convert or $e->request->is_head or $e->response->attachment is effective.
Undefined is returned if there is no $e->response->content_type in the text system.
Egg::Release, Egg::Plugin::Charset::UTF8, Egg::Plugin::Charset::EUC_JP, Egg::Plugin::Charset::Shift_JIS,
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.