NAME

Egg::Plugin::Charset - Base class for Charset plugin.

SYNOPSIS

use Egg qw/ Charset::UTF8 /;

DESCRIPTION

This module is a base class for the following subclasses.

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.

METHODS

no_convert ([BOOL])

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);

get_convert_body

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.

SEE ALSO

Egg::Release, Egg::Plugin::Charset::UTF8, Egg::Plugin::Charset::EUC_JP, Egg::Plugin::Charset::Shift_JIS,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

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.