From: Jarkko Hietaniemi Date: Wed, 10 Apr 2002 22:48:15 +0000 (+0000) Subject: Upgrade to Encode 1.33, from Dan Kogai. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=448e90bb58adc58c025beca8f02643764167d1a2;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Encode 1.33, from Dan Kogai. p4raw-id: //depot/perl@15852 --- diff --git a/ext/Encode/AUTHORS b/ext/Encode/AUTHORS index fce9f0d..b7097a3 100644 --- a/ext/Encode/AUTHORS +++ b/ext/Encode/AUTHORS @@ -23,6 +23,7 @@ Michael G Schwern Nicholas Clark Nick Ing-Simmons Paul Marquess -Philip Newton +Philip Newton SADAHIRO Tomoyuki Spider Boardman +Tatsuhiko Miyagawa diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 9e84446..55e698f 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,9 +1,22 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 1.32 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: Changes,v 1.33 2002/04/10 22:28:40 dankogai Exp dankogai $ # -1.32 $Date: 2002/04/09 20:06:15 $ +1.33 $Date: 2002/04/10 22:28:40 $ +! AUTHORS + Philip's mail address corrected. +! AUTHORS +! t/Encoder.t +! lib/Encode/Encoder.pm + s/= shift;/= @_/g # trivial but a common idiomatic typo :) + This adds Miyagawa-kun to AUTHORS. + * 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 + +1.32 2002/04/09 20:06:15 + bin/ucmlint + t/bogus.ucm - ucm/macDevanaga.ucm Unicode Character Map @@ -233,7 +246,7 @@ Typo fixes and improvements by jhi Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al. -1.11 $Date: 2002/04/09 20:06:15 $ +1.11 $Date: 2002/04/10 22:28:40 $ + t/encoding.t + t/jperl.t ! MANIFEST diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index efc77d8..b1e54e8 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.32 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.33 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; our $DEBUG = 0; require DynaLoader; diff --git a/ext/Encode/bin/piconv b/ext/Encode/bin/piconv index f96512d..b70a1a8 100644 --- a/ext/Encode/bin/piconv +++ b/ext/Encode/bin/piconv @@ -1,5 +1,5 @@ #!./perl -# $Id: piconv,v 1.21 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: piconv,v 1.21 2002/04/09 20:06:15 dankogai Exp $ # use 5.7.3; use strict; diff --git a/ext/Encode/lib/Encode/Encoder.pm b/ext/Encode/lib/Encode/Encoder.pm index 33a3bd5..855b181 100644 --- a/ext/Encode/lib/Encode/Encoder.pm +++ b/ext/Encode/lib/Encode/Encoder.pm @@ -1,14 +1,14 @@ # -# $Id: Encoder.pm,v 0.2 2002/04/08 18:08:07 dankogai Exp $ +# $Id: Encoder.pm,v 0.3 2002/04/10 22:28:40 dankogai Exp dankogai $ # package Encode::Encoder; use strict; use warnings; -our $VERSION = do { my @r = (q$Revision: 0.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 0.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; require Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw ( encoder ); +our @EXPORT_OK = qw ( encoder ); our $AUTOLOAD; our $DEBUG = 0; @@ -34,7 +34,7 @@ sub new{ sub encoder{ __PACKAGE__->new(@_) } sub data{ - my ($self, $data) = shift; + my ($self, $data) = @_; if (defined $data){ $self->{data} = $data; return $data; @@ -106,6 +106,7 @@ Encode::Encoder -- Object Oriented Encoder # Encode::encode("ISO-8859-1", $data); Encoder->new($data)->iso_8859_1; # OOP way # shortcut + use Encode::Encoder qw(encoder); encoder($data)->iso_8859_1; # you can stack them! encoder($data)->iso_8859_1->base64; # provided base64() is defined @@ -166,7 +167,7 @@ This module predefines the methods below; =item $e = Encode::Encoder-Enew([$data, $encoding]); -returns the encoder object. Its data is initialized with $data if +returns an encoder object. Its data is initialized with $data if there, and its encoding is set to $encoding if there. When $encoding is omitted, it defaults to utf8 if $data is already in @@ -174,8 +175,7 @@ utf8 or "" (empty string) otherwise. =item encoder() -is an alias of Encode::Encoder-Enew(). This one is exported for -convenience. +is an alias of Encode::Encoder-Enew(). This one is exported on demand. =item $e-Edata([$data]) diff --git a/ext/Encode/lib/Encode/Supported.pod b/ext/Encode/lib/Encode/Supported.pod index 132e5a9..7b31dbf 100644 --- a/ext/Encode/lib/Encode/Supported.pod +++ b/ext/Encode/lib/Encode/Supported.pod @@ -489,7 +489,7 @@ with Encode. See L for details. UTF-16 UTF-16BE UTF-16LE -are a IANA-registered Cs. See [RFC 2781] for details. +are IANA-registered Cs. See [RFC 2781] for details. Jungshik Shin reports that UTF-16 with a BOM is well accepted by MS IE 5/6 and NS 4/6. Beware however that @@ -525,7 +525,6 @@ you're doing and unless you really benefit from using C. ISO-IR-165 [RFC1345] - GBK VISCII GB 12345 GB 18030 (**) (see links bellow) @@ -712,7 +711,7 @@ L L -The very dspecification of ISO-2022 is available from the link above. +The very specification of ISO-2022 is available from the link above. =back @@ -729,7 +728,7 @@ L Most of the C in Encode derive from this list so you can directly apply the string you have extracted from MIME -header of mails and we pages. +header of mails and web pages. =back diff --git a/ext/Encode/lib/Encode/Unicode.pm b/ext/Encode/lib/Encode/Unicode.pm index 2686df7..2a05ef0 100644 --- a/ext/Encode/lib/Encode/Unicode.pm +++ b/ext/Encode/lib/Encode/Unicode.pm @@ -3,7 +3,7 @@ package Encode::Unicode; use strict; use warnings; -our $VERSION = do { my @r = (q$Revision: 1.29 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.30 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # # Aux. subs & constants @@ -403,7 +403,7 @@ up to \x{10ffff} even with 16-bit encodings. This pair of half-character is now called a I and UTF-16 is the name of the encoding that embraces them. -Here is a fomula to ensurrogate a Unicode character \x{10000} and +Here is a formula to ensurrogate a Unicode character \x{10000} and above; $hi = ($uni - 0x10000) / 0x400 + 0xD800; diff --git a/ext/Encode/t/Encoder.t b/ext/Encode/t/Encoder.t index e970ecc..4cdb252 100644 --- a/ext/Encode/t/Encoder.t +++ b/ext/Encode/t/Encoder.t @@ -1,5 +1,5 @@ # -# $Id: Encoder.t,v 1.1 2002/04/08 18:07:31 dankogai Exp $ +# $Id: Encoder.t,v 1.2 2002/04/10 22:28:40 dankogai Exp dankogai $ # BEGIN { @@ -23,8 +23,8 @@ BEGIN { use strict; #use Test::More 'no_plan'; -use Test::More tests => 512; -use Encode::Encoder; +use Test::More tests => 516; +use Encode::Encoder qw(encoder); use MIME::Base64; package Encode::Base64; use base 'Encode::Encoding'; @@ -41,6 +41,12 @@ sub decode{ package main; +my $e = encoder("foo", "ascii"); +ok ($e->data("bar")); +is ($e->data, "bar"); +ok ($e->encoding("latin1")); +is ($e->encoding, "iso-8859-1"); + my $data = ''; for my $i (0..255){ no warnings; diff --git a/ext/Encode/t/bogus.ucm b/ext/Encode/t/bogus.ucm index 6eb2f72..45883ab 100644 --- a/ext/Encode/t/bogus.ucm +++ b/ext/Encode/t/bogus.ucm @@ -1,5 +1,5 @@ # -# $Id: bogus.ucm,v 1.1 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: bogus.ucm,v 1.1 2002/04/09 20:06:15 dankogai Exp $ # # based upon euc-jp # diff --git a/ext/Encode/ucm/adobeStdenc.ucm b/ext/Encode/ucm/adobeStdenc.ucm index 52a757f..fc2941a 100644 --- a/ext/Encode/ucm/adobeStdenc.ucm +++ b/ext/Encode/ucm/adobeStdenc.ucm @@ -1,5 +1,5 @@ ## -# $Id: adobeStdenc.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: adobeStdenc.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/stdenc.txt diff --git a/ext/Encode/ucm/adobeSymbol.ucm b/ext/Encode/ucm/adobeSymbol.ucm index e7b59c2..79a44c9 100644 --- a/ext/Encode/ucm/adobeSymbol.ucm +++ b/ext/Encode/ucm/adobeSymbol.ucm @@ -1,5 +1,5 @@ # -# $Id: adobeSymbol.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: adobeSymbol.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt diff --git a/ext/Encode/ucm/adobeZdingbat.ucm b/ext/Encode/ucm/adobeZdingbat.ucm index 18e68e7..36792a3 100644 --- a/ext/Encode/ucm/adobeZdingbat.ucm +++ b/ext/Encode/ucm/adobeZdingbat.ucm @@ -1,5 +1,5 @@ # -# $Id: adobeZdingbat.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: adobeZdingbat.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/zdingbat.txt diff --git a/ext/Encode/ucm/macROMnn.ucm b/ext/Encode/ucm/macROMnn.ucm index 90f7a6b..f51382e 100644 --- a/ext/Encode/ucm/macROMnn.ucm +++ b/ext/Encode/ucm/macROMnn.ucm @@ -1,5 +1,5 @@ # -# $Id: macROMnn.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp dankogai $ +# $Id: macROMnn.ucm,v 1.21 2002/04/09 20:06:15 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT