From: Jarkko Hietaniemi Date: Fri, 12 Apr 2002 20:18:41 +0000 (+0000) Subject: Upgrade to Encode 1.34, from Dan Kogai. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=77ea6967de5009ec64c6e0d7050095a84562e267;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Encode 1.34, from Dan Kogai. p4raw-id: //depot/perl@15885 --- diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 55e698f..181f277 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,9 +1,18 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 1.33 2002/04/10 22:28:40 dankogai Exp dankogai $ +# $Id: Changes,v 1.34 2002/04/12 20:23:05 dankogai Exp dankogai $ # -1.33 $Date: 2002/04/10 22:28:40 $ +1.34 $Date: 2002/04/12 20:23:05 $ (Unreleased) +! Encode.pm +! t/Unicode.t + EBCDIC fixes addressed by jhi. + Message-Id: <20020412161844.D9383@alpha.hut.fi> +! lib/Encode/Encoder.pm + POD fix by Miyagawa-kun + Message-Id: <86bscqq4hu.wl@mail.edge.co.jp> + +1.33 2002/04/10 22:28:40 ! AUTHORS Philip's mail address corrected. ! AUTHORS @@ -14,7 +23,9 @@ * encoding() no longer exported by default but on demand * t/Encoder.t updated to test all these Message-Id: <86hemjpdn4.wl@mail.edge.co.jp> - http://www.dan.co.jp/~dankogai/Storable.diff.gz +! lib/Encode/Unicode.pm +! lib/Encode/Supported.pm + Further doc fixes by Anton 1.32 2002/04/09 20:06:15 + bin/ucmlint @@ -246,7 +257,7 @@ Typo fixes and improvements by jhi Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al. -1.11 $Date: 2002/04/10 22:28:40 $ +1.11 $Date: 2002/04/12 20:23:05 $ + t/encoding.t + t/jperl.t ! MANIFEST diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index b1e54e8..3ebe7b9 100644 --- a/ext/Encode/Encode.pm +++ b/ext/Encode/Encode.pm @@ -1,6 +1,6 @@ package Encode; use strict; -our $VERSION = do { my @r = (q$Revision: 1.33 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.34 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; our $DEBUG = 0; require DynaLoader; @@ -203,7 +203,7 @@ sub predefine_encodings{ $_[1] = '' if $chk; return $res; }; - $Encode::Encoding{Internal} = + $Encode::Encoding{Unicode} = bless {Name => "UTF_EBCDIC"} => "Encode::UTF_EBCDIC"; } else { # was in Encode::UTF_EBCDIC diff --git a/ext/Encode/lib/Encode/Encoder.pm b/ext/Encode/lib/Encode/Encoder.pm index 855b181..dbc1839 100644 --- a/ext/Encode/lib/Encode/Encoder.pm +++ b/ext/Encode/lib/Encode/Encoder.pm @@ -1,10 +1,10 @@ # -# $Id: Encoder.pm,v 0.3 2002/04/10 22:28:40 dankogai Exp dankogai $ +# $Id: Encoder.pm,v 0.4 2002/04/12 20:23:05 dankogai Exp dankogai $ # package Encode::Encoder; use strict; use warnings; -our $VERSION = do { my @r = (q$Revision: 0.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 0.4 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; require Exporter; our @ISA = qw(Exporter); @@ -104,7 +104,7 @@ Encode::Encoder -- Object Oriented Encoder use Encode::Encoder; # Encode::encode("ISO-8859-1", $data); - Encoder->new($data)->iso_8859_1; # OOP way + Encode::Encoder->new($data)->iso_8859_1; # OOP way # shortcut use Encode::Encoder qw(encoder); encoder($data)->iso_8859_1; diff --git a/ext/Encode/t/Encoder.t b/ext/Encode/t/Encoder.t index 4cdb252..22c240be 100644 --- a/ext/Encode/t/Encoder.t +++ b/ext/Encode/t/Encoder.t @@ -1,5 +1,5 @@ # -# $Id: Encoder.t,v 1.2 2002/04/10 22:28:40 dankogai Exp dankogai $ +# $Id: Encoder.t,v 1.2 2002/04/10 22:28:40 dankogai Exp $ # BEGIN { diff --git a/ext/Encode/t/Unicode.t b/ext/Encode/t/Unicode.t index e5e7f8b..6436c57 100644 --- a/ext/Encode/t/Unicode.t +++ b/ext/Encode/t/Unicode.t @@ -1,5 +1,5 @@ # -# $Id: Unicode.t,v 1.5 2002/04/08 14:17:19 dankogai Exp $ +# $Id: Unicode.t,v 1.6 2002/04/12 20:23:05 dankogai Exp dankogai $ # # This script is written entirely in ASCII, even though quoted literals # do include non-BMP unicode characters -- Are you happy, jhi? @@ -16,10 +16,11 @@ BEGIN { # print "1..0 # Skip: PerlIO was not built\n"; # exit 0; # } - if (ord("A") == 193) { - print "1..0 # Skip: EBCDIC\n"; - exit 0; - } +# should work on EBCDIC +# if (ord("A") == 193) { +# print "1..0 # Skip: EBCDIC\n"; +# exit 0; +# } $| = 1; } @@ -33,24 +34,27 @@ use Encode qw(encode decode); # http://www.unicode.org/unicode/reports/tr19/ # -my $nasty = "\x{004D}\x{0061}\x{1abcd}"; -my $fallback = "\x{004D}\x{0061}\x{fffd}"; +my $dankogai = "\x{5c0f}\x{98fc}\x{3000}\x{5f3e}"; +my $nasty = "$dankogai\x{1abcd}"; +my $fallback = "$dankogai\x{fffd}"; #hi: (0x1abcd - 0x10000) / 0x400 + 0xD800 = 0xd82a #lo: (0x1abcd - 0x10000) % 0x400 + 0xDC00 = 0xdfcd my $n_16be = - pack("C*", map {hex($_)} qw<00 4D 00 61 d8 2a df cd>); + pack("C*", map {hex($_)} qw<5c 0f 98 fc 30 00 5f 3e d8 2a df cd>); my $n_16le = - pack("C*", map {hex($_)} qw<4D 00 61 00 2a d8 cd df>); + pack("C*", map {hex($_)} qw<0f 5c fc 98 00 30 3e 5f 2a d8 cd df>); my $f_16be = - pack("C*", map {hex($_)} qw<00 4D 00 61 ff fd>); + pack("C*", map {hex($_)} qw<5c 0f 98 fc 30 00 5f 3e ff fd>); my $f_16le = - pack("C*", map {hex($_)} qw<4D 00 61 00 fd ff>); -my $n_32be = - pack("C*", map {hex($_)} qw<00 00 00 4D 00 00 00 61 00 01 ab cd>); + pack("C*", map {hex($_)} qw<0f 5c fc 98 00 30 3e 5f fd ff>); +my $n_32be = + pack("C*", map {hex($_)} + qw<00 00 5c 0f 00 00 98 fc 00 00 30 00 00 00 5f 3e 00 01 ab cd>); my $n_32le = - pack("C*", map {hex($_)} qw<4D 00 00 00 61 00 00 00 cd ab 01 00>); + pack("C*", map {hex($_)} + qw<0f 5c 00 00 fc 98 00 00 00 30 00 00 3e 5f 00 00 cd ab 01 00>); my $n_16bb = pack('n', 0xFeFF) . $n_16be; my $n_16lb = pack('v', 0xFeFF) . $n_16le;