From: Jarkko Hietaniemi Date: Sat, 27 Apr 2002 15:48:34 +0000 (+0000) Subject: Upgrade to Encode 1.62. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fc17bd483fe538010972a975723fc880f8afb203;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Encode 1.62. p4raw-id: //depot/perl@16214 --- diff --git a/ext/Encode/Changes b/ext/Encode/Changes index ad4fabb..1bc3925 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,9 +1,18 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 1.61 2002/04/26 03:02:04 dankogai Exp $ +# $Id: Changes,v 1.62 2002/04/27 11:17:39 dankogai Exp dankogai $ # -$Revision: 1.61 $ $Date: 2002/04/26 03:02:04 $ +$Revision: 1.62 $ $Date: 2002/04/27 11:17:39 $ +! Encode.pm + encodings() now just check %ExtModule instead of eval{require} + all of them for ":all" to conserve more memory. +! Encode.xs + more "%x" -> "%" UVxf stuff. +! Encode.pm + s/=over2/=over 2/g # oops. + +1.61 2002/04/26 03:02:04 ! t/mime-header.t Now does decent tests besides use_ok() ! lib/Encode/Guess.pm t/guess.t @@ -511,7 +520,7 @@ $Revision: 1.61 $ $Date: 2002/04/26 03:02:04 $ Typo fixes and improvements by jhi Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al. -1.11 $Date: 2002/04/26 03:02:04 $ +1.11 $Date: 2002/04/27 11:17:39 $ + t/encoding.t + t/jperl.t ! MANIFEST diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index e6c54f0..f0f8f9d 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.61 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.62 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; our $DEBUG = 0; use XSLoader (); XSLoader::load 'Encode'; @@ -53,17 +53,21 @@ eval { require Encode::ConfigLocal }; sub encodings { my $class = shift; - my @modules = (@_ and $_[0] eq ":all") ? values %ExtModule : @_; - for my $mod (@modules){ - $mod =~ s,::,/,g or $mod = "Encode/$mod"; - $mod .= '.pm'; - $DEBUG and warn "about to require $mod;"; - eval { require $mod; }; + my %enc; + if (@_ and $_[0] eq ":all"){ + %enc = ( %Encoding, %ExtModule ); + }else{ + %enc = %Encoding; + for my $mod (map {m/::/o ? $_ : "Encode::$_" } @_){ + $DEBUG and warn $mod; + for my $enc (keys %ExtModule){ + $ExtModule{$enc} eq $mod and $enc{$enc} = $mod; + } + } } - my %modules = map {$_ => 1} @modules; return sort { lc $a cmp lc $b } - grep {!/^(?:Internal|Unicode)$/o} keys %Encoding; + grep {!/^(?:Internal|Unicode|Guess)$/o} keys %enc; } sub perlio_ok{ diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 566d066..57af0ad 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -1,5 +1,5 @@ /* - $Id: Encode.xs,v 1.39 2002/04/26 03:02:04 dankogai Exp $ + $Id: Encode.xs,v 1.40 2002/04/27 11:17:39 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -169,21 +169,23 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src, else { if (check & ENCODE_DIE_ON_ERR){ Perl_croak( - aTHX_ "%s \"\\x%02X\" does not map to Unicode (%d)", + aTHX_ "%s \"\\x%02" UVXf + "\" does not map to Unicode (%d)", enc->name[0], (U8) s[slen], code); }else{ if (check & ENCODE_RETURN_ON_ERR){ if (check & ENCODE_WARN_ON_ERR){ Perl_warner( aTHX_ packWARN(WARN_UTF8), - "%s \"\\x%02X\" does not map to Unicode (%d)", + "%s \"\\x%02" UVXf + "\" does not map to Unicode (%d)", enc->name[0], (U8) s[slen], code); } goto ENCODE_SET_SRC; }else if (check & (ENCODE_PERLQQ|ENCODE_HTMLCREF|ENCODE_XMLCREF)){ SV* perlqq = - sv_2mortal(newSVpvf("\\x%02X", s[slen])); + sv_2mortal(newSVpvf("\\x%02" UVXf, s[slen])); sdone += slen + 1; ddone += dlen + SvCUR(perlqq); sv_catsv(dst, perlqq);