GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BADGER::CODEC::ENCODE (3)

.ds Aq ’

NAME

Badger::Codec::Encode - codec wrapper around Encode

CONTENTS

SYNOPSIS



    use Badger::Codec::Encode;
   
    my $codec    = Badger::Codec::Encode->new();
    my $encoded = $codec->encode( utf8 => "...some utf8 data..." );
    my $decoded = $codec->decode( utf8 => $encoded );



DESCRIPTION

This module is a subclass of Badger::Codec implementing a very thin wrapper around the Encode module. It exists only to provide a consistent API with other Badger::Codec modules and to facilitate codec chaining.

You would normally use a codec via the Badger::Codecs module.



    use Badger::Codecs
        codec => encode;
   
    my $encoding = UTF-8;
    my $uncoded  = "...some UTF-8 data...";
    my $encoded  = encode($encoding, $uncoded);
    my $decoded  = decode($encoding, $encoded)



The above example is identical to using the Encode module directly:



    use Encode;     # also exports encode()/decode()



In addition, a Badger::Codec::Encode object will be available via the codec() subroutine.



    my $encoded  = codec->encode($encoding, $uncoded);
    my $decoded  = codec->decode($encoding, $encoded)



METHODS

encode($encoding, CW$data)

Method for encoding data which forwards all arguments to the Encode encode() method. The first argument is the encoding, the second is the data to encode.



    $encoded = Badger::Codec::Encode->encode( utf8 => $data );



decode($encoding, CW$data)

Method for decoding data which forwards all arguments to the Encode decode() method. The first argument is the encoding, the second is the data to decode.



    $decoded = Badger::Codec::Encode->decode( utf8 => $encoded );



encoder()

This method returns a reference to the real subroutine that’s doing all the encoding work, i.e. the encode() function in Encode.

decoder()

This method returns a reference to the real subroutine that’s doing all the encoding work, i.e. the decode() method in Encode.

AUTHOR

Andy Wardley <http://wardley.org/>

COPYRIGHT

Copyright (C) 2005-2009 Andy Wardley. All rights reserved.

SEE ALSO

Encode, Badger::Codecs, Badger::Codec, Badger::Codec::Unicode.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 BADGER::CODEC::ENCODE (3) 2010-02-20

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.