NAME

Egg::Helper::P::Charset - Helper for plugin charset.

SYNOPSIS

% cd /MYPROJECT_ROOT/bin

% perl myproject_helper.pl P:Charset [CHARCODE_NAME]

output file: /MYPROJECT_ROOT/lib/Egg/Plugin/Charset/CHARCODE_NAME.pm

This module is a helper who generates the skeleton of the module for plugin Charset.

perl myproject_helper.pl P:Charset [CHARCODE_NAME]

'Egg::Plugin::Charset::[CHARCODE_NAME]' can be done /MYPROJECT_ROOT/lib in this.

This is edited, and an original Charset::* plugin is made.

  • prepare

    $e->response->content_type("text/html; charset=[CHARSET]");
    $e->response->content_language('[LANGUAGE]');

    'Content-Type' and 'Content-Language' must be setup by processing's beginning.

  • _charset_convert_type

    $e->response->content_type=~m{^text/html} ? 1: 0;

    It is called when there is no 'Content-Type' in the text. Return ture to the call that may convert the character-code.

    * The code conversion processing is done in the example only at text/html.

  • _output_convert_charset

    The character-code conversion processing must be done by this method.

    Because the value of body is passed to the argument by the SCALAR reference, it is processed.

* There is especially no prepare needing. It becomes an error if there are neither '_charset_convert_type' nor '_output_convert_charset'.

It registers to the controller as follows when completing it.

use Egg qw/Charset::[CHARCODE_NAME]/;

It is built in the project by this.

SEE ALSO

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

AUTHOR

Masatoshi Mizuno, <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

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.