},
'Encode' => {
- 'DISTRIBUTION' => 'DANKOGAI/Encode-2.57.tar.gz',
+ 'DISTRIBUTION' => 'DANKOGAI/Encode-2.60.tar.gz',
'FILES' => q[cpan/Encode],
- 'CUSTOMIZED' => [
- # Waiting to be merged upstream: see CPAN RT#95130
- qw(
- bin/enc2xs
- Byte/Makefile.PL
- CN/Makefile.PL
- EBCDIC/Makefile.PL
- encengine.c
- Encode/encode.h
- Encode/encode.h
- Encode/Makefile_PL.e2x
- Encode.pm
- Encode.xs
- JP/Makefile.PL
- KR/Makefile.PL
- Symbol/Makefile.PL
- TW/Makefile.PL
- Unicode/Unicode.xs
- ),
- ],
},
'encoding::warnings' => {
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
#
-# $Id: Encode.pm,v 2.57 2014/01/03 04:51:39 dankogai Exp $
+# $Id: Encode.pm,v 2.60 2014/04/29 16:26:49 dankogai Exp dankogai $
#
package Encode;
use strict;
use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.57_01 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.60 $ =~ /(\d+)/g;
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
=head2 coderef for CHECK
As of C<Encode> 2.12, C<CHECK> can also be a code reference which takes the
-ordinal value of the unmapped character as an argument and returns a string
-that represents the fallback character. For instance:
+ordinal value of the unmapped character as an argument and returns
+octets that represent the fallback character. For instance:
$ascii = encode("ascii", $utf8, sub{ sprintf "<U+%04X>", shift });
Acts like C<FB_PERLQQ> but U+I<XXXX> is used instead of C<\x{I<XXXX>}>.
+Even the fallback for C<decode> must return octets, which are
+then decoded with the character encoding that C<decode> accepts. So for
+example if you wish to decode octests as UTF-8, and use ISO-8859-15 as
+a fallback for bytes that are not valid UTF-8, you could write
+
+ $str = decode 'UTF-8', $octets, sub {
+ my $tmp = chr shift;
+ from_to $tmp, 'ISO-8859-15', 'UTF-8';
+ return $tmp;
+ };
+
=head1 Defining Encodings
To define a new encoding, use:
/*
- $Id: Encode.xs,v 2.24 2013/08/29 16:47:39 dankogai Exp $
+ $Id: Encode.xs,v 2.27 2014/04/29 16:25:06 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))), stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i]) {
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
/*
- $Id: Unicode.xs,v 2.10 2013/04/26 18:30:46 dankogai Exp $
+ $Id: Unicode.xs,v 2.11 2014/04/29 16:25:06 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
if (endian == 'v')
break;
v |= (*s++ << 16);
- v |= (*s++ << 24);
+ v |= ((UV)*s++ << 24);
break;
default:
croak("Unknown endian %c",(char) endian);
use Getopt::Std;
use Config;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 2.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.12 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
{
dSP;
HV *stash = gv_stashpv("Encode::XS", TRUE);
- SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
+ SV *iv = newSViv(PTR2IV(enc));
+ SV *sv = sv_bless(newRV_noinc(iv),stash);
int i = 0;
+ SvFLAGS(iv) |= SVp_POK;
+ SvPVX(iv) = enc->name[0];
PUSHMARK(sp);
XPUSHs(sv);
while (enc->name[i])
#!./perl
-# $Id: piconv,v 2.5 2013/04/26 18:30:46 dankogai Exp $
+# $Id: piconv,v 2.6 2014/03/28 02:37:42 dankogai Exp $
#
use 5.8.0;
use strict;
EOT
}
-my %use_bom = map { $_ => 1 } qw/UTF-16 UTF-32/;
+my %use_bom =
+ map { $_ => 1 } qw/UTF-16 UTF-16BE UTF-16LE UTF-32 UTF-32BE UTF-32LE/;
# we do not use <> (or ARGV) for the sake of binmode()
@ARGV or push @ARGV, \*STDIN;
unless ( $scheme eq 'perlio' ) {
binmode STDOUT;
- my $need2slurp = $use_bom{ find_encoding($to)->name };
+ my $need2slurp = $use_bom{ find_encoding($to)->name }
+ || $use_bom{ find_encoding($from)->name };
for my $argv (@ARGV) {
my $ifh = ref $argv ? $argv : undef;
$ifh or open $ifh, "<", $argv or warn "Can't open $argv: $!" and next;
-D,--debug show debug information
-S,--scheme scheme use the scheme for conversion
Those are handy when you can only see ASCII characters:
- -p,--perlqq transliterate characters missing in encoding to \x{HHHH}
+ -p,--perlqq transliterate characters missing in encoding to \\x{HHHH}
where HHHH is the hexadecimal Unicode code point
--htmlcref transliterate characters missing in encoding to &#NNN;
where NNN is the decimal Unicode code point
Digest::MD5 cpan/Digest-MD5/t/files.t bdbe05b705d9da305fedce7a9f4b6ba63250c7cf
-Encode cpan/Encode/bin/enc2xs e8eb480be70267e0c2ac9df7f18a6e329c64e494
-Encode cpan/Encode/Byte/Makefile.PL dbceeb6ba7cb05df3d30412a4390d40ed8e4af5d
-Encode cpan/Encode/CN/Makefile.PL 3c28dcb8bbb0f0f16deec6e7f76e4701dadba364
-Encode cpan/Encode/EBCDIC/Makefile.PL de8ad9cfea819fcab809b90d97431dbdf0ec53cd
-Encode cpan/Encode/encengine.c 8e59c3e3a2bc9c866531f653c7377250495c27f4
-Encode cpan/Encode/Encode.pm cf239e1b3a79a564d01a9a011f7ebc80f4551a65
-Encode cpan/Encode/Encode.xs 4edcc474315eb3f38f53e24418bca7e7c2809cc8
-Encode cpan/Encode/Encode/encode.h 69a2a11529d868017b9d1fcfe00069621d7c0503
-Encode cpan/Encode/Encode/Makefile_PL.e2x 804949878b675562dddac59600d29232ddff7fe0
-Encode cpan/Encode/JP/Makefile.PL c5039f65c3b40c536f04beee9c8c47de888c65fa
-Encode cpan/Encode/KR/Makefile.PL 10d1ad37b196da1eaf49671fa5b65a744d232040
-Encode cpan/Encode/Symbol/Makefile.PL 7337ce85aa6bcc562d123ea184995dec7bc9f521
-Encode cpan/Encode/TW/Makefile.PL 686ea18ef9da743d961981a20ea19d391808d256
-Encode cpan/Encode/Unicode/Unicode.xs 27731231063734c063c661f3af4d95150f9d87ac
Module::Build cpan/Module-Build/lib/Module/Build/ConfigData.pm 85eb9656e68d1f256737dc52d86b5d0fed28f832
PerlIO::via::QuotedPrint cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t ca39f0146e89de02c746e199c45dcb3e5edad691
Text::Balanced cpan/Text-Balanced/t/01_compile.t 1598cf491a48fa546260a2ec41142abe84da533d