NAME

Egg::Plugin::Encode - The encode of the character is supported for Egg.

SYNOPSIS

package MYPROJECT;
use stirct;
use Egg qw/Encode/;

Example of code.

$e->encode->set(\$string)->utf8;

my $euc_str = $e->euc_conv(\$any_code_string);
my $utf8_str= $e->utf8_conv(\$any_code_string);
my $sjis_str= $e->sjis_conv(\$any_code_string);

DESCRIPTION

This module adds the method for the treatment of the character-code. And, the operation united by the character-code set to 'character_in' when acquisition and the cookie of Ricestoceri are set is done.

The default of 'character_in' is euc.

Jcode is used for the conversion of the character-code. It is possible to change by adding the following codes to the controller.

package MYPROJECT;
use Unicode::Japanese;
....

sub create_encode {
	Unicode::Japanese->new('character');
}

Euc_conv, sjis_conv, and utf8_conv can be used in default.

Please give to the operation of the module that Orbaraids these methods and uses it additionally if there is a problem.

Moreover, please add the method newly to treat the code that this module doesn't assume.

sub ucs2_conv {
	my($e, $str)= @_;
	$e->encode->set($str)->ucs2;
}
sub anycode_conv {
	my($e, $str)= @_;
	$e->encode->set($str)->anycode;
}

And, please set the code to 'character_in' if you want to do to the code for internal processing of default.

character_in=> 'ucs2',

or

character_in=> 'anycode',

* It seems to fail in the encode of the request query in utf8 'character_in'. The encode of the request query is turned off in setting 'disable_encode_query' as an emergency measure.

METHODS

encode

The object received with create_encode is returned.

Default is 'Jcode'.

euc_conv , utf8_conv , sjis_conv

It is an accessor for the character-code conversion.

is_utf8

utf8::is_utf8 is done.

utf8enc

utf8::encode is done.

utf8dec

utf8::decode is done.

SEE ALSO

Jcode, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Masatoshi Mizuno <mizuno@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.