Nicholas Clark <nick@ccl4.org>
Nick Ing-Simmons <nick@ing-simmons.net>
Paul Marquess <paul_marquess@yahoo.co.uk>
-Philip Newton <Philip.Newton@gmx.net>
+Philip Newton <pne@cpan.org>
SADAHIRO Tomoyuki <SADAHIRO@cpan.org>
Spider Boardman <spider@web.zk3.dec.com>
+Tatsuhiko Miyagawa <miyagawa@edge.co.jp>
# 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
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
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;
#!./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;
#
-# $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;
sub encoder{ __PACKAGE__->new(@_) }
sub data{
- my ($self, $data) = shift;
+ my ($self, $data) = @_;
if (defined $data){
$self->{data} = $data;
return $data;
# 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
=item $e = Encode::Encoder-E<gt>new([$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
=item encoder()
-is an alias of Encode::Encoder-E<gt>new(). This one is exported for
-convenience.
+is an alias of Encode::Encoder-E<gt>new(). This one is exported on demand.
=item $e-E<gt>data([$data])
UTF-16 UTF-16BE UTF-16LE
-are a IANA-registered C<charset>s. See [RFC 2781] for details.
+are IANA-registered C<charset>s. 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
ISO-IR-165 [RFC1345]
- GBK
VISCII
GB 12345
GB 18030 (**) (see links bellow)
L<http://www.ecma.ch/ecma1/STAND/ECMA-035.HTM>
-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
Most of the C<canonical names> 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
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
half-character is now called a I<Surrogate Pair> 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;
#
-# $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 {
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';
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;
#
-# $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
#
##
-# $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
#
-# $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
#
-# $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
#
-# $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