SUGAWARA Hajime <sugawara@hdt.co.jp>
SUZUKI Norio <ZAP00217@nifty.com>
Simon Cozens <simon@netthink.co.uk>
+Slaven Rezic <SREZIC@cpan.org>
Spider Boardman <spider@web.zk3.dec.com>
Steve Hay <steve.hay@uk.radan.com>
Steve Peters <steve@fisharerojo.org>
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.17 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: Changes,v 2.19 2007/04/06 12:53:41 dankogai Exp dankogai $
#
-$Revision: 2.17 $ $Date: 2006/06/03 20:28:48 $
+$Revision: 2.19 $ $Date: 2007/04/06 12:53:41 $
+! lib/Encode/JP/JIS7.pm
++ t/jis7-fallback.t
+ encode('iso-2022-jp') fallback support added by MIYAGAWA++
+ decode()'s fallback remains unchanged (FB_PERLQQ) since UTF-8
+ contains all characters in iso-2022-jp so there's no need for fancy stuff.
+ Message-Id: <693254b90704060526s6d850320h71cdda50dfbf7eba@mail.gmail.com>
+! Encode.pm
+ #25216 ([PATCH] Encode.pm: postpone the load of Encode::Encoding)
+ http://rt.cpan.org/NoAuth/Bug.html?id=#25216
+! lib/Encode/MIME/Header.pm t/mime-header.t
+ #24418 (Encode::MIME::Header: wrong encoding with latin1 characters)
+ http://rt.cpan.org/NoAuth/Bug.html?id=#24418
+! Encode.pm
+ #23876 (Add documentation for LEAVE_SRC)
+ http://rt.cpan.org/NoAuth/Bug.html?id=#23876
+! lib/Encode/Alias.pm t/Aliases.t
+ #20781: Thai encoding needs alias for tis-620
+ http://rt.cpan.org/NoAuth/Bug.html?id=#20781
+! bin/piconv AUTHORS
+ #20344: piconv: wrong conversion of utf-16le encoded files (with PATCH)
+ http://rt.cpan.org/NoAuth/Bug.html?id=#20344
+! Encode.pm Encode.xs bin/enc2xs encoding.pm t/Aliases.t t/utf8strict.t
+ Imported from bleedperl's 2.18_01
+
+2.18 2006/06/03 20:28:48
! bin/enc2xs
overhauled the -C option
- added ascii-ctrl', 'null', 'utf-8-strict' to core
#
-# $Id: Encode.pm,v 2.18 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: Encode.pm,v 2.19 2007/04/06 12:53:41 dankogai Exp dankogai $
#
package Encode;
use strict;
use warnings;
-our $VERSION = "2.18_01";
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.19 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
#
sub predefine_encodings {
- use Encode::Encoding;
+ require Encode::Encoding;
no warnings 'redefine';
my $use_xs = shift;
if ($ON_EBCDIC) {
=back
+=item Encode::LEAVE_SRC
+
+If the C<Encode::LEAVE_SRC> bit is not set, but I<CHECK> is, then the second
+argument to C<encode()> or C<decode()> may be assigned to by the functions. If
+you're not interested in this, then bitwise-or the bitmask with it.
+
=head2 coderef for CHECK
As of Encode 2.12 CHECK can also be a code reference which takes the
/*
- $Id: Encode.xs,v 2.10 2006/06/03 20:28:48 dankogai Exp dankogai $
+ $Id: Encode.xs,v 2.11 2007/04/06 12:53:41 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
#!./perl
-# $Id: piconv,v 2.2 2006/05/03 18:24:10 dankogai Exp $
+# $Id: piconv,v 2.3 2007/04/06 12:53:41 dankogai Exp dankogai $
#
use 5.8.0;
use strict;
my $from = $Opt{from} || $locale or help("from_encoding unspecified");
my $to = $Opt{to} || $locale or help("to_encoding unspecified");
$Opt{string} and Encode::from_to($Opt{string}, $from, $to) and print $Opt{string} and exit;
-my $scheme = exists $Scheme{$Opt{Scheme}} ? $Opt{Scheme} : 'from_to';
+my $scheme = exists $Scheme{$Opt{scheme}} ? $Opt{scheme} : 'from_to';
$Opt{check} ||= $Opt{c};
$Opt{perlqq} and $Opt{check} = Encode::PERLQQ;
$Opt{htmlcref} and $Opt{check} = Encode::HTMLCREF;
The new perlIO layer is used. NI-S' favorite.
+You should use this option if you are using UTF-16 and others which
+linefeed is not $/.
+
=back
Like the I<-D> option, this is also for Encode hackers.
-# $Id: encoding.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: encoding.pm,v 2.5 2007/04/06 12:53:41 dankogai Exp dankogai $
package encoding;
-our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode;
use strict;
This pragma affects utf8::upgrade, but not utf8::downgrade.
+=head2 Side effects
+
+If the C<encoding> pragma is in scope then the lengths returned are
+calculated from the length of C<$/> in Unicode characters, which is not
+always the same as the length of C<$/> in the native encoding.
+
+This pragma affects utf8::upgrade, but not utf8::downgrade.
+
=head1 FEATURES THAT REQUIRE 5.8.1
Some of the features offered by this pragma requires perl 5.8.1. Most
use warnings;
no warnings 'redefine';
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
sub DEBUG () { 0 }
use base qw(Exporter);
'greek' => 'iso-8859-7',
'hebrew' => 'iso-8859-8',
'thai' => 'iso-8859-11',
- 'tis620' => 'iso-8859-11',
);
+ # RT #20781
+ define_alias(qr/\btis-?620\b/i => '"iso-8859-11"');
# At least AIX has IBM-NNN (surprisingly...) instead of cpNNN.
# And Microsoft has their own naming (again, surprisingly).
#
-# $Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $
#
package Encode::CJKConstants;
use strict;
use warnings;
-our $RCSID = q$Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $;
+our $RCSID = q$Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $;
our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Carp;
#
-# $Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $
#
package Encode::JP::H2Z;
use strict;
use warnings;
-our $RCSID = q$Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $;
+our $RCSID = q$Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $;
our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode::CJKConstants qw(:all);
package Encode::JP::JIS7;
use strict;
use warnings;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(:fallbacks);
# empty the input string in the stack so perlio is ok
$_[1] = '' if $chk;
my ( $h2z, $jis0212 ) = @$obj{qw(h2z jis0212)};
- my $octet = Encode::encode( 'euc-jp', $utf8, FB_PERLQQ );
+ my $octet = Encode::encode( 'euc-jp', $utf8, $chk );
$h2z and &Encode::JP::H2Z::h2z( \$octet );
euc_jis( \$octet, $jis0212 );
return $octet;
use warnings;
no warnings 'redefine';
-our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8 decode_utf8);
use MIME::Base64;
use Carp;
sub _encode_q {
my $chunk = shift;
+ $chunk = encode_utf8($chunk);
$chunk =~ s{
([^0-9A-Za-z])
}{
join("" => map {sprintf "=%02X", $_} unpack("C*", $1))
}egox;
- return decode_utf8( HEAD . 'Q?' . $chunk . TAIL );
+ return HEAD . 'Q?' . $chunk . TAIL;
}
1;
#
-# $Id: UTF7.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp dankogai $
+# $Id: UTF7.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp $
#
package Encode::Unicode::UTF7;
use strict;
'hebrew' => 'iso-8859-8',
'thai' => 'iso-8859-11',
'tis620' => 'iso-8859-11',
+ 'tis-620' => 'iso-8859-11',
'WinLatin1' => 'cp1252',
'WinLatin2' => 'cp1250',
'WinCyrillic' => 'cp1251',
print "# alias test with alias overrides\n";
foreach my $a (keys %a2c){
+ print "# $a => $a2c{$a}\n";
my $e = Encode::find_encoding($a);
is((defined($e) and $e->name), $a2c{$a}, "Override $a")
or warn "alias was $a";
#
-# $Id: mime-header.t,v 2.2 2006/05/03 18:24:10 dankogai Exp $
+# $Id: mime-header.t,v 2.3 2007/04/06 12:53:41 dankogai Exp dankogai $
# This script is written in utf8
#
BEGIN {
use strict;
#use Test::More qw(no_plan);
-use Test::More tests => 11;
+use Test::More tests => 12;
use_ok("Encode::MIME::Header");
my $eheader =<<'EOS';
is(Encode::encode('MIME-Q' => $pound_1024), '=?UTF-8?Q?=C2=A31024?=',
'pound 1024');
}
+
+is(Encode::encode('MIME-Q', "\x{fc}"), '=?UTF-8?Q?=C3=BC?=', 'Encode latin1 characters');
+
__END__;