Encode::compat - Encode.pm emulation layer


Encode-compat documentation Contained in the Encode-compat distribution.

Index


Code Index:

NAME

Top

Encode::compat - Encode.pm emulation layer

VERSION

Top

This document describes version 0.07 of Encode::compat, released June 3, 2004.

SYNOPSIS

Top

    use Encode::compat; # a no-op for Perl v5.7.1+
    use Encode qw(...); # all constants and imports works transparently

    # use Encode functions as normal

DESCRIPTION

Top

WARNING: THIS IS A PROOF-OF-CONCEPT. Most functions are incomplete. All implementation details are subject to change!

This module provide a compatibility layer for Encode.pm users on perl versions earlier than v5.7.1. It translates whatever call it receives into Text::Iconv, or (in the future) Unicode::MapUTF8 to perform the actual work.

The is_utf8(), _utf8_on() and _utf8_off() calls are performed by the method native to the perl version -- 5.6.1 would use pack/unpack, 5.6.0 uses tr//CU, etc.

Theoretically, it could be backported to 5.005 and earlier, with none of the unicode-related semantics available, and serves only as a abstraction layer above Text::Iconv, Unicode::MapUTF8 and possibly other transcoding modules.

CAVEATS

Top

Currently, this module only support 5.6.1+, and merely provides the three utility function above (encode(), decode() and from_to()), with a very kludgy FB_HTMLCREF fallback against latin-1 in from_to().

SEE ALSO

Top

Encode, perlunicode

AUTHORS

Top

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

Top


Encode-compat documentation Contained in the Encode-compat distribution.

# $File: //member/autrijus/Encode-compat/lib/Encode/compat.pm $ $Author: autrijus $
# $Revision: #7 $ $Change: 10735 $ $DateTime: 2004/06/03 14:08:57 $

package Encode::compat;
$Encode::compat::VERSION = '0.07';

use strict;

if ($] >= 5.007001 or $INC{'Encode.pm'}) {
    # nothing happens -- Encode.pm already available.
}
elsif ($] >= 5.006001 and $] <= 5.007) {
    require Encode::compat::Alias;
    $INC{'Encode/Alias.pm'} = $INC{'Encode/compat/Alias.pm'};

    require Encode::compat::common;
    require Encode::compat::5006001;
    $INC{'Encode.pm'} = __FILE__;
}
else {
    die "Encode.pm compatibility layer for $] not yet available.";
}

1;

__END__