From: Dan Kogai Date: Wed, 29 May 2002 03:43:57 +0000 (+0900) Subject: [Encode] 1.74 released -- final for 5.8.0-RC1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0a41339d8cc9b81101f492ab383301252ea41fd;p=p5sagit%2Fp5-mst-13.2.git [Encode] 1.74 released -- final for 5.8.0-RC1 Message-Id: p4raw-id: //depot/perl@16840 --- diff --git a/MANIFEST b/MANIFEST index ab5fc95..00f3d1b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -335,6 +335,7 @@ ext/Encode/ucm/cp932.ucm Unicode Character Map ext/Encode/ucm/cp936.ucm Unicode Character Map ext/Encode/ucm/cp949.ucm Unicode Character Map ext/Encode/ucm/cp950.ucm Unicode Character Map +ext/Encode/ucm/ctrl.ucm Unicode Character Map ext/Encode/ucm/dingbats.ucm Unicode Character Map ext/Encode/ucm/euc-cn.ucm Unicode Character Map ext/Encode/ucm/euc-jp.ucm Unicode Character Map @@ -374,6 +375,7 @@ ext/Encode/ucm/macThai.ucm Unicode Character Map ext/Encode/ucm/macTurkish.ucm Unicode Character Map ext/Encode/ucm/macUkraine.ucm Unicode Character Map ext/Encode/ucm/nextstep.ucm Unicode Character Map +ext/Encode/ucm/null.ucm Unicode Character Map ext/Encode/ucm/posix-bc.ucm Unicode Character Map ext/Encode/ucm/shiftjis.ucm Unicode Character Map ext/Encode/ucm/symbol.ucm Unicode Character Map diff --git a/ext/Encode/AUTHORS b/ext/Encode/AUTHORS index ac65486..1c8dfc6 100644 --- a/ext/Encode/AUTHORS +++ b/ext/Encode/AUTHORS @@ -13,6 +13,7 @@ Andreas J. Koenig Anton Tagunov Autrijus Tang Benjamin Goldberg +Chris Nandor Craig A. Berry Dan Kogai Elizabeth Mattijsen diff --git a/ext/Encode/Byte/Makefile.PL b/ext/Encode/Byte/Makefile.PL index 3fe7345..6390522 100644 --- a/ext/Encode/Byte/Makefile.PL +++ b/ext/Encode/Byte/Makefile.PL @@ -1,6 +1,7 @@ use 5.7.2; use strict; use ExtUtils::MakeMaker; +use File::Spec::Functions; my $name = 'Byte'; my %tables = ( @@ -43,7 +44,7 @@ my %not_here = qw(cp932.ucm cp936.ucm cp949.ucm cp950.ucm), # CJK ); -opendir(ENC,'../ucm'); +opendir(ENC,catdir(updir(),'ucm')) or die $!; while (defined(my $file = readdir(ENC))) { $file =~ /^(8859|cp).*\.ucm$/io or next; @@ -83,6 +84,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -92,6 +95,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/CN/Makefile.PL b/ext/Encode/CN/Makefile.PL index 1dd713a..61e1844 100644 --- a/ext/Encode/CN/Makefile.PL +++ b/ext/Encode/CN/Makefile.PL @@ -60,6 +60,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -69,6 +71,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 5ab37a9..42408e5 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,9 +1,28 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 1.72 2002/05/20 15:49:56 dankogai Exp dankogai $ +# $Id: Changes,v 1.74 2002/05/28 18:33:15 dankogai Exp dankogai $ # -$Revision: 1.72 $ $Date: 2002/05/20 15:49:56 $ +$Revision: 1.74 $ $Date: 2002/05/28 18:33:15 $ ++ ucm/null.ucm ucm/ctrl.ucm +! Makefile.PL bin/enc2xs lib/Encode/Supported.pod + "null" and "ascii-ctrl" encodings added upon the request of Autrijus + Subject: Re: unicode -> &# notation + Message-ID: <20020518193704.GB40272@not.autrijus.org> + +1.73 2002/05/28 17:26:18 +! */Makefile.PL Makefile.PL bin/enc2xs Encode/Makefile_PL.e2x AUTHORS + Chris Nandor has fixed Encode so that it works w/ MacPerl -- + at least w/ PPC (68k need static linking which does not work due to + 64k limit). pudge is added to AUTHORS (I'm surprised he was not + there in the list). Encode/Makefile_PL.e2x was additionally fixed + by dankogai to reflect changes in other Makefile.PL + Message-Id: +! t/mime-header.t + Subject: Change 16746: -Mutf8 cleanup. + Message-Id: <200205222345.g4MNj7e10597@smtp3.ActiveState.com> + +1.72 2002/05/20 15:49:56 ! Makefile.PL Subject: [PATCH] Encode should be in perl-core library path Message-Id: <86r8k7h738.wl@mail.edge.co.jp> @@ -652,7 +671,7 @@ $Revision: 1.72 $ $Date: 2002/05/20 15:49:56 $ Typo fixes and improvements by jhi Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al. -1.11 $Date: 2002/05/20 15:49:56 $ +1.11 $Date: 2002/05/28 18:33:15 $ + t/encoding.t + t/jperl.t ! MANIFEST diff --git a/ext/Encode/EBCDIC/Makefile.PL b/ext/Encode/EBCDIC/Makefile.PL index 73152ee..12016e7 100644 --- a/ext/Encode/EBCDIC/Makefile.PL +++ b/ext/Encode/EBCDIC/Makefile.PL @@ -41,6 +41,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -50,6 +52,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index cfcaacc..0f57a03 100644 --- a/ext/Encode/Encode.pm +++ b/ext/Encode/Encode.pm @@ -1,9 +1,9 @@ # -# $Id: Encode.pm,v 1.72 2002/05/20 15:26:18 dankogai Exp $ +# $Id: Encode.pm,v 1.74 2002/05/28 18:33:54 dankogai Exp dankogai $ # package Encode; use strict; -our $VERSION = do { my @r = (q$Revision: 1.72 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.74 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; our $DEBUG = 0; use XSLoader (); XSLoader::load(__PACKAGE__, $VERSION); diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index ff582d0..e631106 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -1,5 +1,5 @@ /* - $Id: Encode.xs,v 1.46 2002/05/20 15:25:44 dankogai Exp $ + $Id: Encode.xs,v 1.46 2002/05/20 15:25:44 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT diff --git a/ext/Encode/Encode/Makefile_PL.e2x b/ext/Encode/Encode/Makefile_PL.e2x index a82e774..3bca0bf 100644 --- a/ext/Encode/Encode/Makefile_PL.e2x +++ b/ext/Encode/Encode/Makefile_PL.e2x @@ -73,6 +73,9 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + # The next two lines to make MacPerl Happy -- dankogai via pudge + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; # $self->{'H'} = [$self->catfile($self->updir,'encode.h')]; my %xs; foreach my $table (keys %tables) { diff --git a/ext/Encode/JP/Makefile.PL b/ext/Encode/JP/Makefile.PL index b4a4ed0..a3b19d4 100644 --- a/ext/Encode/JP/Makefile.PL +++ b/ext/Encode/JP/Makefile.PL @@ -60,6 +60,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -69,6 +71,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/KR/Makefile.PL b/ext/Encode/KR/Makefile.PL index 88fce24..525e064 100644 --- a/ext/Encode/KR/Makefile.PL +++ b/ext/Encode/KR/Makefile.PL @@ -58,6 +58,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -67,6 +69,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/MANIFEST b/ext/Encode/MANIFEST index cc6a141..45fd869 100644 --- a/ext/Encode/MANIFEST +++ b/ext/Encode/MANIFEST @@ -136,6 +136,7 @@ ucm/cp932.ucm Unicode Character Map ucm/cp936.ucm Unicode Character Map ucm/cp949.ucm Unicode Character Map ucm/cp950.ucm Unicode Character Map +ucm/ctrl.ucm Unicode Character Map ucm/dingbats.ucm Unicode Character Map ucm/euc-cn.ucm Unicode Character Map ucm/euc-jp.ucm Unicode Character Map @@ -175,6 +176,7 @@ ucm/macThai.ucm Unicode Character Map ucm/macTurkish.ucm Unicode Character Map ucm/macUkraine.ucm Unicode Character Map ucm/nextstep.ucm Unicode Character Map +ucm/null.ucm Unicode Character Map ucm/posix-bc.ucm Unicode Character Map ucm/shiftjis.ucm Unicode Character Map ucm/symbol.ucm Unicode Character Map diff --git a/ext/Encode/Makefile.PL b/ext/Encode/Makefile.PL index 9a18224..2e74fe4 100644 --- a/ext/Encode/Makefile.PL +++ b/ext/Encode/Makefile.PL @@ -10,6 +10,8 @@ my %tables = ( def_t => ['ascii.ucm', '8859-1.ucm', + 'null.ucm', + 'ctrl.ucm', ] ); @@ -75,6 +77,8 @@ sub post_initialize { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'clean'}{'FILES'} .= join(' ',@files); return ''; @@ -85,7 +89,7 @@ sub postamble my $self = shift; my $dir = $self->catdir($self->curdir,'ucm'); my $str = "# Encode\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n"; - $str .= 'Encode$(OBJ_EXT) :'; + $str .= $^O eq 'MacOS' ? 'Encode.c.{$(MACPERL_BUILD_EXT_STATIC)}.o :' : 'Encode$(OBJ_EXT) :'; foreach my $table (keys %tables) { $str .= " $table.c"; diff --git a/ext/Encode/Symbol/Makefile.PL b/ext/Encode/Symbol/Makefile.PL index e1fa906..045cc16 100644 --- a/ext/Encode/Symbol/Makefile.PL +++ b/ext/Encode/Symbol/Makefile.PL @@ -46,6 +46,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -55,6 +57,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/TW/Makefile.PL b/ext/Encode/TW/Makefile.PL index 65cc224..15efd03 100644 --- a/ext/Encode/TW/Makefile.PL +++ b/ext/Encode/TW/Makefile.PL @@ -56,6 +56,8 @@ sub post_initialize $self->{'O_FILES'} = [sort keys %o]; my @files = ("$name.xs"); $self->{'C'} = ["$name.c"]; + $self->{SOURCE} .= " $name.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; $self->{'H'} = [$self->catfile($self->updir,'Encode', 'encode.h')]; my %xs; foreach my $table (keys %tables) { @@ -65,6 +67,8 @@ sub post_initialize foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) { push (@files,$table.$ext); } + $self->{SOURCE} .= " $table.c" + if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/; } $self->{'XS'} = { "$name.xs" => "$name.c" }; $self->{'clean'}{'FILES'} .= join(' ',@files); diff --git a/ext/Encode/bin/enc2xs b/ext/Encode/bin/enc2xs index a54663c..6f6b10f 100644 --- a/ext/Encode/bin/enc2xs +++ b/ext/Encode/bin/enc2xs @@ -8,7 +8,7 @@ BEGIN { use strict; use Getopt::Std; my @orig_ARGV = @ARGV; -our $VERSION = do { my @r = (q$Revision: 1.27 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.29 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # These may get re-ordered. # RAW is a do_now as inserted by &enter @@ -265,6 +265,11 @@ if ($doC) my $sym = "${enc}_encoding"; $sym =~ s/\W+/_/g; print C "encode_t $sym = \n"; + # This is to make null encoding work -- dankogai + for (my $i = (scalar @info) - 1; $i >= 0; --$i){ + $info[$i] ||= 1; + } + # end of null tweak -- dankogai print C " {",join(',',@info,"{\"$enc\",(const char *)0}"),"};\n\n"; } @@ -702,7 +707,8 @@ sub outtable } if ($a->{'Forward'}) { - print $fh "\nstatic encpage_t $name\[",scalar(@{$a->{'Entries'}}),"];\n"; + my $var = $^O eq 'MacOS' ? 'extern' : 'static'; + print $fh "\n$var encpage_t $name\[",scalar(@{$a->{'Entries'}}),"];\n"; } $a->{'Done'} = 1; foreach my $b (@{$a->{'Entries'}}) diff --git a/ext/Encode/lib/Encode/Supported.pod b/ext/Encode/lib/Encode/Supported.pod index f7b66fa..4061f52 100644 --- a/ext/Encode/lib/Encode/Supported.pod +++ b/ext/Encode/lib/Encode/Supported.pod @@ -61,10 +61,18 @@ The following encodings are always available. Canonical Aliases Comments & References ---------------------------------------------------------------- ascii US-ascii [ECMA] + ascii-ctrl Special Encoding iso-8859-1 latin1 [ISO] + null Special Encoding utf8 UTF-8 [RFC2279] ---------------------------------------------------------------- +I and I are special. "null" fails for all character +so when you set fallback mode to PERLQQ, HTMLCREF or XMLCREF, ALL +CHARACTERS will fall back to character references. Ditto for +"ascii-ctrl" except for control characters. For fallback modes, see +L. + =head2 Encode::Unicode -- other Unicode encodings Unicode coding schemes other than native utf8 are supported by diff --git a/ext/Encode/t/mime-header.t b/ext/Encode/t/mime-header.t index 5b2714b..745fb1c 100644 --- a/ext/Encode/t/mime-header.t +++ b/ext/Encode/t/mime-header.t @@ -1,5 +1,5 @@ # -# $Id: mime-header.t,v 1.4 2002/05/04 16:41:18 dankogai Exp $ +# $Id: mime-header.t,v 1.5 2002/05/23 19:10:10 dankogai Exp $ # This script is written in utf8 # BEGIN { diff --git a/ext/Encode/ucm/ctrl.ucm b/ext/Encode/ucm/ctrl.ucm new file mode 100644 index 0000000..2137531 --- /dev/null +++ b/ext/Encode/ucm/ctrl.ucm @@ -0,0 +1,42 @@ +# +# $Id: ctrl.ucm,v 1.1 2002/05/28 18:33:15 dankogai Exp dankogai $ +# + "ascii-ctrl" + 1 + 1 + \x3F +# +CHARMAP + \x00 |0 # + \x01 |0 # + \x02 |0 # + \x03 |0 # + \x04 |0 # + \x05 |0 # + \x06 |0 # + \x07 |0 # + \x08 |0 # + \x09 |0 # + \x0A |0 # + \x0B |0 # + \x0C |0 # + \x0D |0 # + \x0E |0 # + \x0F |0 # + \x10 |0 # + \x11 |0 # + \x12 |0 # + \x13 |0 # + \x14 |0 # + \x15 |0 # + \x16 |0 # + \x17 |0 # + \x18 |0 # + \x19 |0 # + \x1A |0 # + \x1B |0 # + \x1C |0 # + \x1D |0 # + \x1E |0 # + \x1F |0 # +END CHARMAP diff --git a/ext/Encode/ucm/null.ucm b/ext/Encode/ucm/null.ucm new file mode 100644 index 0000000..9d8a739 --- /dev/null +++ b/ext/Encode/ucm/null.ucm @@ -0,0 +1,10 @@ +# +# $Id: null.ucm,v 1.1 2002/05/28 18:33:15 dankogai Exp dankogai $ +# + "null" + 1 + 1 + \x3F +# +CHARMAP +END CHARMAP