# 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
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
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';
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{
/*
- $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
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);