ext/Encode/t/encoding.t test script
ext/Encode/t/enc_utf8.t test script
ext/Encode/t/fallback.t test script
+ext/Encode/t/from_to.t test script
ext/Encode/t/gb2312.enc test data
ext/Encode/t/gb2312.utf test data
ext/Encode/t/grow.t test script
Spider Boardman <spider@web.zk3.dec.com>
Steve Hay <steve.hay@uk.radan.com>
Steve Peters <steve@fisharerojo.org>
-Tatsuhiko Miyagawa <miyagawa@edge.co.jp>
+Tatsuhiko Miyagawa <miyagawa@bulknews.net>
Tels <perl_dummy@bloodgate.com>
Vadim Konovalov <vkonovalov@peterstar.ru>
Yitzchak Scott-Thoennes <sthoenna@efn.org>
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.12 2005/09/08 14:17:17 dankogai Exp dankogai $
+# $Id: Changes,v 2.14 2006/01/15 15:43:36 dankogai Exp dankogai $
#
-$Revision: 2.12 $ $Date: 2005/09/08 14:17:17 $
+
+$Revision: 2.14 $ $Date: 2006/01/15 15:43:36 $
+2.14 2006/01/15 15:06:36 $
+! Makefile.PL
+ Change 26295: Don't build manpages for Encode and Unicode::Normalize
+ Message-Id: <200512071540.jB7Fe4Gt017960@smtp3.ActiveState.com>
+! Encode.pm
+ Change 26081: Pod nit in Encode.pm, found by Marc Lehmann in RT #36949.
+ Message-Id: <200511110357.jAB3vZcP023647@smtp3.ActiveState.com>
+! Encode.xs Encode/encode.h bin/enc2xs encengine.c
+ Change 25821: Mark more static Encode data structures as const.
+ Change 25823: use more 'const' in the Encode data structures.
+ Message-Id: <200510221243.j9MChTSu027711@smtp3.ActiveState.com>
+ Message-Id: <200510221343.j9MDhTk9001245@smtp3.ActiveState.com>
+
+2.13 2006/01/15 15:06:36
+! AUTHORS
+ Miyagawa's mail address updated
+ Message-Id: <693254b90601150535o767e10bai4f4732c275b4ebe0@mail.gmail.com>
+! lib/Encode/MIME/Header.pm
+ #16413: Encode::MIME::Headers patch to solve what is probably someone else's bug
+ http://rt.cpan.org/NoAuth/Bug.html?id=16413
+! lib/Encode/MIME/Header.pm t/mime-header.t
+ Applied: RT #16258: Support for RFC 2184 language tag
+ http://rt.cpan.org/NoAuth/Bug.html?id=16258
+! Encode.pm
+ Fixed RT #14559: fix for #8872 introduces new "bug"
+ http://rt.cpan.org/NoAuth/Bug.html?id=14559
+! Encode.pm
++ t/from_to.t
+ from_to() now makes use of $check more naturally.
+ Message-Id: <693254b90601150535o767e10bai4f4732c275b4ebe0@mail.gmail.com>
+ <B10B4DE2-9BAF-4344-B3BE-2119977D817A@dan.co.jp>
+
+2.12 2005/09/08 14:17:17
! Encode.xs Encode.pm t/fallback.t
Now accepts coderef for CHECK!
! ucm/8859-7.ucm
#
-# $Id: Encode.pm,v 2.12 2005/09/08 14:17:17 dankogai Exp dankogai $
+# $Id: Encode.pm,v 2.14 2006/01/15 15:43:36 dankogai Exp dankogai $
#
package Encode;
use strict;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.12 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.14 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
require Carp;
Carp::croak("Unknown encoding '$to'");
}
- my $uni = $f->decode($string,$check);
- return undef if ($check && length($string));
- $string = $t->encode($uni,$check);
+ my $uni = $f->decode($string);
+ $_[0] = $string = $t->encode($uni,$check);
return undef if ($check && length($uni));
- return defined($_[0] = $string) ? length($string) : undef ;
+ return defined($_[0]) ? length($string) : undef ;
}
sub encode_utf8($)
sub decode_utf8($;$)
{
my ($str, $check) = @_;
+ return $str if is_utf8($str);
if ($check){
return decode("utf8", $str, $check);
}else{
/*
- $Id: Encode.xs,v 2.6 2005/09/08 14:17:17 dankogai Exp dankogai $
+ $Id: Encode.xs,v 2.7 2006/01/15 15:43:36 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
t/enc_utf8.t test script
t/encoding.t test script
t/fallback.t test script
+t/from_to.t test script
t/gb2312.enc test data
t/gb2312.utf test data
t/grow.t test script
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Encode
-version: 2.12
+version: 2.14
version_from: Encode.pm
installdirs: perl
requires:
use warnings;
use Getopt::Std;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 2.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
-# $Id: encoding.pm,v 2.2 2005/09/08 14:17:17 dankogai Exp dankogai $
+# $Id: encoding.pm,v 2.2 2005/09/08 14:17:17 dankogai Exp $
package encoding;
our $VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use strict;
use vars qw($VERSION);
-$VERSION = do { my @r = (q$Revision: 2.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+$VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode qw(:fallbacks);
}
}
else { # GB mode; the byte ranges are as in RFC 1843.
+ no warnings 'uninitialized';
if ($str =~ s/^((?:[\x21-\x77][\x21-\x7E])+)//) {
$ret .= $GB->decode($1, $chk);
}
package Encode::MIME::Header;
use strict;
# use warnings;
-our $VERSION = do { my @r = (q$Revision: 2.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8 decode_utf8);
use MIME::Base64;
use Carp;
$str =~ s/\?=\s+=\?/\?==\?/gos;
# multi-line header to single line
$str =~ s/(:?\r|\n|\r\n)[ \t]//gos;
+
+ 1 while ($str =~ s/(\=\?[0-9A-Za-z\-_]+\?[Qq]\?)(.*?)\?\=\1(.*?)\?\=/$1$2$3\?\=/); # Concat consecutive QP encoded mime headers
+ # Fixes breaking inside multi-byte characters
+
$str =~
s{
=\? # begin encoded word
([0-9A-Za-z\-_]+) # charset (encoding)
+ (?:\*[A-Za-z]{1,8}(?:-[A-Za-z]{1,8})*)? # language (RFC 2231)
\?([QqBb])\? # delimiter
(.*?) # Base64-encodede contents
\?= # end encoded word
(?:
=\? # begin encoded word
(?:[0-9A-Za-z\-_]+) # charset (encoding)
+ (?:\*\w+(?:-\w+)*)? # language (RFC 2231)
\?(?:[QqBb])\? # delimiter
(?:.*?) # Base64-encodede contents
\?= # end encoded word
--- /dev/null
+# $Id: from_to.t,v 1.1 2006/01/15 15:06:36 dankogai Exp $
+use strict;
+use Test::More tests => 3;
+use Encode qw(encode from_to);
+
+my $foo = encode("utf-8", "\x{5abe}");
+from_to($foo, "utf-8" => "latin1", Encode::FB_HTMLCREF);
+ok !Encode::is_utf8($foo);
+is $foo, '媾';
+
+my $bar = encode("latin-1", "\x{5abe}", Encode::FB_HTMLCREF);
+is $bar, '媾';
#
-# $Id: mime-header.t,v 2.0 2004/05/16 20:55:19 dankogai Exp $
+# $Id: mime-header.t,v 2.1 2006/01/15 15:06:36 dankogai Exp $
# This script is written in utf8
#
BEGIN {
use strict;
#use Test::More qw(no_plan);
-use Test::More tests => 10;
+use Test::More tests => 11;
use_ok("Encode::MIME::Header");
my $eheader =<<'EOS';
is(Encode::decode('MIME-Header', $uheader), $dheader, "decode UTF-8 (RFC2047)");
+my $lheader =<<'EOS';
+From: =?US-ASCII*en-US?Q?Keith_Moore?= <moore@cs.utk.edu>
+To: =?ISO-8859-1*da-DK?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
+CC: =?ISO-8859-1*fr-BE?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
+Subject: =?ISO-8859-1*en?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
+ =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
+EOS
+
+is(Encode::decode('MIME-Header', $lheader), $dheader, "decode language tag (RFC2231)");
+
$dheader=<<'EOS';
From: 小飼 弾 <dankogai@dan.co.jp>
#
-# $Id: 8859-7.ucm,v 2.1 2005/09/08 14:17:17 dankogai Exp dankogai $
+# $Id: 8859-7.ucm,v 2.1 2005/09/08 14:17:17 dankogai Exp $
#
# Original table can be obtained at
# http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-7.TXT