Dan Kogai <dankogai@dan.co.jp>
Elizabeth Mattijsen <liz@dijkmat.nl>
Gerrit P. Haase <gp@familiehaase.de>
+Graham Barr <gbarr@pobox.com>
Gurusamy Sarathy <gsar@activestate.com>
H.Merijn Brand <h.m.brand@hccnet.nl>
Jarkko Hietaniemi <jhi@iki.fi>
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 1.68 2002/05/03 12:20:13 dankogai Exp $
+# $Id: Changes,v 1.69 2002/05/04 16:41:18 dankogai Exp dankogai $
#
-$Revision: 1.68 $ $Date: 2002/05/03 12:20:13 $
+$Revision: 1.69 $ $Date: 2002/05/04 16:41:18 $
+! lib/Encode/MIME/Header
+ Floating-point coerced for UNICOS (in integer arithmetics it folds
+ line one character too early). Verification by Mark is pending.
+ Message-Id: <C670F60D-5F4F-11D6-A5CA-00039301D480@dan.co.jp>
+! Unicode/Unicode.pm
+ more doc patch from Elizabeth
+ Message-Id: <4.2.0.58.20020503210946.02f4ed30@mickey.dijkmat.nl>
+! Encode/Makefile_PL.e2x
+ More platform-independent patch from Benjamin
+ Message-Id: <3CD31BE0.69F79B06@earthlink.net>
+! lib/Encode/Guess AUTHORS
+ split regex fix by Graham Barr. Adds him to AUTHORS.
+ Message-Id: <20020504085419.E95940@valueclick.com>
+! Encode/Makefile_PL.e2x
+ enc2xs script discovery made smarter and more sensible, first cited
+ by Miyagawa-kun and further suggestions by Rafael and Andreas
+! Encode.pm lib/Encode/Guess.pm t/fallback.t t/guess.t t/mime-header.t
+ "The EBCDIC remapping of the low 256 bites again" #16372 by jhi
+
+1.68 2002/05/03 12:20:13
! lib/Encode/Alias.pm lib/Encode/Supported.pod t/Alias.t AUTHORS
UCS-4 added to aliases of UTF-32 by Elizabeth Mattijsen. Alias.t
and Supported.pod modified to reflect the change. Elizabeth added
Typo fixes and improvements by jhi
Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al.
-1.11 $Date: 2002/05/03 12:20:13 $
+1.11 $Date: 2002/05/04 16:41:18 $
+ t/encoding.t
+ t/jperl.t
! MANIFEST
#
-# $Id: Encode.pm,v 1.68 2002/05/03 12:20:31 dankogai Exp $
+# $Id: Encode.pm,v 1.69 2002/05/04 16:41:18 dankogai Exp dankogai $
#
package Encode;
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.68 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.69 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our $DEBUG = 0;
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
require File::Spec;
my ($enc2xs, $encode_h) = ();
PATHLOOP:
-for my $d (@Config{qw/bin sitebin vendorbin/},
- (split /:/, $ENV{PATH})){
+for my $d (@Config{qw/bin sitebin vendorbin/},
+ (split /$Config{path_sep}/o, $ENV{PATH})){
for my $f (qw/enc2xs enc2xs5.7.3/){
my $path = File::Spec->catfile($d, $f);
-x $path and $enc2xs = $path and last PATHLOOP;
use strict;
use warnings;
-our $VERSION = do { my @r = (q$Revision: 1.36 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.37 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use XSLoader;
XSLoader::load(__PACKAGE__,$VERSION);
I<Character Encoding Scheme> A character encoding form plus byte
serialization. There are seven character encoding schemes in Unicode:
-UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE and UTF-32LE.
+UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32 (UCS-4), UTF-32BE (UCS-4BE) and
+UTF-32LE (UCS-4LE).
=item Quick Reference
or above is encountered during encode(), it C<ensurrogate>s them and
pushes the surrogate pair to the output stream.
-UTF-32 is a fixed-length encoding with each character taking 32 bits.
+UTF-32 (UCS-4) is a fixed-length encoding with each character taking 32 bits.
Since it is 32-bit, there is no need for I<surrogate pairs>.
=head2 by endianness
=head1 SEE ALSO
L<Encode>, L<http://www.unicode.org/glossary/>,
+L<http://www.unicode.org/unicode/faq/utf_bom.html>,
RFC 2781 L<http://rfc.net/rfc2781.html>,
-L<http://www.unicode.org/unicode/faq/utf_bom.html>
+The whole Unicode standard L<http://www.unicode.org/unicode/uni2book/u2.html>
Ch. 15, pp. 403 of C<Programming Perl (3rd Edition)>
by Larry Wall, Tom Christiansen, Jon Orwant;
define_alias( qr/^(.*)$/ => '"\L$1"' );
# UTF/UCS stuff
- define_alias( qr/^UCS-?2-?LE$/i => '"UCS-2LE"' );
- define_alias( qr/^UCS-?2-?(BE)?$/i => '"UCS-2BE"',
+ define_alias( qr/^UCS-?2-?LE$/i => '"UCS-2LE"' );
+ define_alias( qr/^UCS-?2-?(BE)?$/i => '"UCS-2BE"',
qr/^UCS-?4-?(BE|LE)?$/i => 'uc("UTF-32$1")',
- qr/^iso-10646-1$/i => '"UCS-2BE"' );
- define_alias( qr/^UTF(16|32)-?BE$/i => '"UTF-$1BE"',
- qr/^UTF(16|32)-?LE$/i => '"UTF-$1LE"',
- qr/^UTF(16|32)$/i => '"UTF-$1"',
+ qr/^iso-10646-1$/i => '"UCS-2BE"' );
+ define_alias( qr/^UTF(16|32)-?BE$/i => '"UTF-$1BE"',
+ qr/^UTF(16|32)-?LE$/i => '"UTF-$1LE"',
+ qr/^UTF(16|32)$/i => '"UTF-$1"',
);
# ASCII
define_alias(qr/^(?:US-?)ascii$/i => '"ascii"');
use strict;
use Encode qw(:fallbacks find_encoding);
-our $VERSION = do { my @r = (q$Revision: 1.5 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.6 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
my $Canon = 'Guess';
our $DEBUG = 0;
$DEBUG and warn "Added: ", $e->name;
}
my $nline = 1;
- for my $line (split /\r|\n|\r\n/, $octet){
+ for my $line (split /\r\n?|\n/, $octet){
# cheat 2 -- \e in the string
if ($line =~ /\e/o){
my @keys = keys %try;
package Encode::MIME::Header;
use strict;
# use warnings;
-our $VERSION = do { my @r = (q$Revision: 1.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.4 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8);
use MIME::Base64;
my ($o, $str) = @_;
my $enc = $o->{encode};
my $llen = ($o->{bpl} - length(HEAD) - 2 - length(TAIL));
- $llen *= $enc eq 'B' ? 3/4 : 1/3;
+ # to coerce a floating-point arithmetics, the following contains
+ # .0 in numbers -- dankogai
+ $llen *= $enc eq 'B' ? 3.0/4.0 : 1.0/3.0;
my @result = ();
my $chunk = '';
while(my $chr = substr($str, 0, 1, '')){
#
-# $Id: mime-header.t,v 1.3 2002/04/26 03:07:59 dankogai Exp $
+# $Id: mime-header.t,v 1.4 2002/05/04 16:41:18 dankogai Exp dankogai $
# This script is written in utf8
#
BEGIN {