diff options
author | Dan Kogai <dankogai@dan.co.jp> | 2020-12-02 17:13:45 -0500 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2020-12-02 17:15:55 -0500 |
commit | 0aee951734c79edb5ed4d81e8c932cc34e5eda55 (patch) | |
tree | 9e06b9682cb13b50bd330eb7402fcad85c2b8a01 /cpan | |
parent | 9cbb5ac7dcf644c817e4072abb4f08e1eb92ae0c (diff) | |
download | perl-0aee951734c79edb5ed4d81e8c932cc34e5eda55.tar.gz |
cpan/Encode: sync with CPAN version 3.08
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Encode/Encode.pm | 4 | ||||
-rw-r--r-- | cpan/Encode/Makefile.PL | 4 | ||||
-rw-r--r-- | cpan/Encode/bin/encguess | 4 | ||||
-rw-r--r-- | cpan/Encode/lib/Encode/GSM0338.pm | 11 | ||||
-rw-r--r-- | cpan/Encode/t/gsm0338.t | 54 |
5 files changed, 19 insertions, 58 deletions
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index 77ca93e87b..d3eb3c1b11 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -1,5 +1,5 @@ # -# $Id: Encode.pm,v 3.07 2020/07/25 12:59:10 dankogai Exp $ +# $Id: Encode.pm,v 3.08 2020/12/02 01:27:44 dankogai Exp $ # package Encode; use strict; @@ -7,7 +7,7 @@ use warnings; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; our $VERSION; BEGIN { - $VERSION = sprintf "%d.%02d", q$Revision: 3.07 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%02d", q$Revision: 3.08 $ =~ /(\d+)/g; require XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); } diff --git a/cpan/Encode/Makefile.PL b/cpan/Encode/Makefile.PL index 8c20d20226..f9c774845f 100644 --- a/cpan/Encode/Makefile.PL +++ b/cpan/Encode/Makefile.PL @@ -1,5 +1,5 @@ # -# $Id: Makefile.PL,v 2.22 2017/10/06 22:21:53 dankogai Exp $ +# $Id: Makefile.PL,v 2.23 2020/12/02 01:28:17 dankogai Exp dankogai $ # use 5.007003; use strict; @@ -70,7 +70,7 @@ WriteMakefile( Storable => '0', # bundled with Perl 5.7.3 }, TEST_REQUIRES => { - 'Test::More' => '0.81_01', + 'Test::More' => '0.92', }, PMLIBDIRS => \@pmlibdirs, INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'), diff --git a/cpan/Encode/bin/encguess b/cpan/Encode/bin/encguess index 0f344ea3fc..19a0673e76 100644 --- a/cpan/Encode/bin/encguess +++ b/cpan/Encode/bin/encguess @@ -61,7 +61,7 @@ encguess - guess character encodings of files =head1 VERSION -$Id: encguess,v 0.2 2016/08/04 03:15:58 dankogai Exp $ +$Id: encguess,v 0.3 2020/12/02 01:28:17 dankogai Exp dankogai $ =head1 SYNOPSIS @@ -78,7 +78,7 @@ show this message and exit. =item -s specify a list of "suspect encoding types" to test, -seperated by either C<:> or C<,> +separated by either C<:> or C<,> =item -S diff --git a/cpan/Encode/lib/Encode/GSM0338.pm b/cpan/Encode/lib/Encode/GSM0338.pm index 8b23a7bb6a..644d445285 100644 --- a/cpan/Encode/lib/Encode/GSM0338.pm +++ b/cpan/Encode/lib/Encode/GSM0338.pm @@ -1,5 +1,5 @@ # -# $Id: GSM0338.pm,v 2.8 2020/07/25 12:59:29 dankogai Exp dankogai $ +# $Id: GSM0338.pm,v 2.9 2020/12/02 01:28:17 dankogai Exp dankogai $ # package Encode::GSM0338; @@ -8,16 +8,13 @@ use warnings; use Carp; use vars qw($VERSION); -$VERSION = do { my @r = ( q$Revision: 2.8 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +$VERSION = do { my @r = ( q$Revision: 2.9 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use Encode qw(:fallbacks); use parent qw(Encode::Encoding); __PACKAGE__->Define('gsm0338'); -sub needs_lines { 1 } -sub perlio_ok { 0 } - use utf8; # Mapping table according to 3GPP TS 23.038 version 16.0.0 Release 16 and ETSI TS 123 038 V16.0.0 (2020-07) @@ -182,6 +179,10 @@ sub decode ($$;$) { ? $chk->( unpack 'C*', $seq ) : "\x{FFFD}"; if ( not exists $GSM2UNI{$seq} and $chk and not ref $chk ) { + if ( substr($seq, 0, 1) eq $ESC and ($chk & Encode::STOP_AT_PARTIAL) ) { + $bytes .= $seq; + last; + } croak join( '', map { sprintf "\\x%02X", $_ } unpack 'C*', $seq ) . ' does not map to Unicode' if $chk & Encode::DIE_ON_ERR; carp join( '', map { sprintf "\\x%02X", $_ } unpack 'C*', $seq ) . ' does not map to Unicode' if $chk & Encode::WARN_ON_ERR; if ($chk & Encode::RETURN_ON_ERR) { diff --git a/cpan/Encode/t/gsm0338.t b/cpan/Encode/t/gsm0338.t index 21a82fad5e..ab985838f3 100644 --- a/cpan/Encode/t/gsm0338.t +++ b/cpan/Encode/t/gsm0338.t @@ -13,7 +13,7 @@ BEGIN { use strict; use utf8; -use Test::More tests => 776; +use Test::More tests => 777; use Encode; use Encode::GSM0338; @@ -83,49 +83,9 @@ is encode("gsm0338", chr(0xC7)) => "\x09", 'RT75670: encode'; is decode("gsm0338", encode('gsm0338', '..@@..')), '..@@..'; is decode("gsm0338", encode('gsm0338', '..@€..')), '..@€..'; -__END__ -for my $c (map { chr } 0..127){ - my $b = "\x1b$c"; - my $u = $Encode::GSM0338::GSM2UNI{$b}; - next unless $u; - $u ||= "\xA0" . $Encode::GSM0338::GSM2UNI{$c}; - is decode("gsm0338", $b), $u, sprintf("decode ESC+\\x%02X", ord($c) ); -} - -__END__ -# old test follows -ub t { is(decode("gsm0338", my $t = $_[0]), $_[1]) } - -# t("\x00", "\x00"); # ??? - -# "Round-trip". -t("\x41", "\x41"); - -t("\x01", "\xA3"); -t("\x02", "\x24"); -t("\x03", "\xA5"); -t("\x09", "\xE7"); - -t("\x00\x00", "\x00\x00"); # Maybe? -t("\x00\x1B", "\x40\xA0"); # Maybe? -t("\x00\x41", "\x40\x41"); - -# t("\x1B", "\x1B"); # ??? - -# Escape with no special second byte is just a NBSP. -t("\x1B\x41", "\xA0\x41"); - -t("\x1B\x00", "\xA0\x40"); # Maybe? - -# Special escape characters. -t("\x1B\x0A", "\x0C"); -t("\x1B\x14", "\x5E"); -t("\x1B\x28", "\x7B"); -t("\x1B\x29", "\x7D"); -t("\x1B\x2F", "\x5C"); -t("\x1B\x3C", "\x5B"); -t("\x1B\x3D", "\x7E"); -t("\x1B\x3E", "\x5D"); -t("\x1B\x40", "\x7C"); -t("\x1B\x40", "\x7C"); -t("\x1B\x65", "\x{20AC}"); +# special GSM sequence, € is at 1024 byte buffer boundary +my $gsm = "\x41" . "\x1B\x65" x 1024; +open my $fh, '<:encoding(gsm0338)', \$gsm or die; +my $uni = <$fh>; +close $fh; +is $uni, "A" . "€" x 1024, 'PerlIO encoding(gsm0338) read works'; |