Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 73802ce

Browse files
committed
Encode 2.98
fixed some -Wsign-compare See L<https://metacpan.org/changes/distribution/Encode> Skip the flapping test F<t/Aliases.t> on threaded smokers, with random segfaults. This is a long standing core bug, with PMOP aliases or clone. First observed at L<rurban/perl-compiler#73> (since 5.6) Stop directory tweaking C<$Encode::Encoding{utf8}> Fix gcc warnings for older gcc < 4.0 Where possible do not depend on value of $@, instead use return value of eval Fix more XS problems in Encode.xs file Load modules Encode::MIME::Name and Storable normally Remove no warnings redefine; and correctly loaddependences Remove PP stubs and reformat predefine_encodings() Run Encode XS BOOT code at compile time Use Encode::define_encoding and propagate carp/croak message cperl fixes: encoding undeprecated, no strict hashpairs Cleanup code for handling fallback/replacement characters lib/Encode/MIME/Name.pm t/mime-name.t Pulled: Add "euc-cn" => "EUC-CN" alias to Encode::MIME::Name dankogai/p5-encode#124 lib/Encode/CN/HZ.pm lib/Encode/JP/JIS7.pm lib/Encode/MIME/Header.pm t/decode.t Pulled: Uninitialized value fixes #122 dankogai/p5-encode#122 Makefile.PL Pulled: Fix -Werror=declaration-after-statement for gcc 4.1.2 dankogai/p5-encode#121 Fixed deep recursion in Encode::find_encoding when decoding.
1 parent 9dc8da4 commit 73802ce

File tree

14 files changed

+275
-273
lines changed

14 files changed

+275
-273
lines changed

Porting/Maintainers.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ package Maintainers;
575575
},
576576

577577
'Encode' => {
578-
'DISTRIBUTION' => 'DANKOGAI/Encode-2.93.tar.gz',
578+
'DISTRIBUTION' => 'DANKOGAI/Encode-2.98.tar.gz',
579579
'FILES' => q[cpan/Encode],
580580
# undeprecate encoding
581581
'CUSTOMIZED' => [ qw(

cpan/Encode/Encode.pm

+9-29
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#
2-
# $Id: Encode.pm,v 2.93 2017/10/06 22:21:33 dankogai Exp $
2+
# $Id: Encode.pm,v 2.98 2018/04/22 09:03:00 dankogai Exp $
33
#
44
package Encode;
55
use strict;
66
use warnings;
77
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
88
our $VERSION;
99
BEGIN {
10-
$VERSION = sprintf "%d.%02d", q$Revision: 2.93 $ =~ /(\d+)/g;
10+
$VERSION = sprintf "%d.%02d", q$Revision: 2.98 $ =~ /(\d+)/g;
1111
require XSLoader;
1212
XSLoader::load( __PACKAGE__, $VERSION );
1313
}
@@ -949,38 +949,11 @@ different kinds of strings and string-operations in Perl: one a
949949
byte-oriented mode for when the internal UTF8 flag is off, and the other a
950950
character-oriented mode for when the internal UTF8 flag is on.
951951
952-
Here is how C<Encode> handles the UTF8 flag.
953-
954-
=over 2
955-
956-
=item *
957-
958-
When you I<encode>, the resulting UTF8 flag is always B<off>.
959-
960-
=item *
961-
962-
When you I<decode>, the resulting UTF8 flag is B<on>--I<unless> you can
963-
unambiguously represent data. Here is what we mean by "unambiguously".
964-
After C<$str = decode("foo", $octet)>,
965-
966-
When $octet is... The UTF8 flag in $str is
967-
---------------------------------------------
968-
In ASCII only (or EBCDIC only) OFF
969-
In ISO-8859-1 ON
970-
In any other Encoding ON
971-
---------------------------------------------
972-
973-
As you see, there is one exception: in ASCII. That way you can assume
974-
Goal #1. And with C<Encode>, Goal #2 is assumed but you still have to be
975-
careful in the cases mentioned in the B<CAVEAT> paragraphs above.
976-
977952
This UTF8 flag is not visible in Perl scripts, exactly for the same reason
978953
you cannot (or rather, you I<don't have to>) see whether a scalar contains
979954
a string, an integer, or a floating-point number. But you can still peek
980955
and poke these if you will. See the next section.
981956
982-
=back
983-
984957
=head2 Messing with Perl's Internals
985958
986959
The following API uses parts of Perl's internals in the current
@@ -995,6 +968,13 @@ release.
995968
If I<CHECK> is true, also checks whether I<STRING> contains well-formed
996969
UTF-8. Returns true if successful, false otherwise.
997970
971+
Typically only necessary for debugging and testing. Don't use this flag as
972+
a marker to distinguish character and binary data, that should be decided
973+
for each variable when you write your code.
974+
975+
B<CAVEAT>: If I<STRING> has UTF8 flag set, it does B<NOT> mean that
976+
I<STRING> is UTF-8 encoded and vice-versa.
977+
998978
As of Perl 5.8.1, L<utf8> also has the C<utf8::is_utf8> function.
999979
1000980
=head3 _utf8_on

0 commit comments

Comments
 (0)