You are viewing the version of this documentation from Perl 5.12.3. View the latest version

CONTENTS

NAME

Encode::Encoder -- Object Oriented Encoder

SYNOPSIS

use Encode::Encoder;
# Encode::encode("ISO-8859-1", $data); 
Encode::Encoder->new($data)->iso_8859_1; # OOP way
# shortcut
use Encode::Encoder qw(encoder);
encoder($data)->iso_8859_1;
# you can stack them!
encoder($data)->iso_8859_1->base64;  # provided base64() is defined
# you can use it as a decoder as well
encoder($base64)->bytes('base64')->latin1;
# stringified
print encoder($data)->utf8->latin1;  # prints the string in latin1
# numified
encoder("\x{abcd}\x{ef}g")->utf8 == 6; # true. bytes::length($data)