diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2018-01-09 12:43:33 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2018-01-09 13:49:48 +0000 |
commit | 13a15ab6260f12f5f0d897fa08be543dfb3214ba (patch) | |
tree | 74f4b4d5b50b700c90dc15d2c311d0ed6dc2c84e /cpan/Encode | |
parent | de3293c06d610babde277963c152d0294afadc9e (diff) | |
download | perl-13a15ab6260f12f5f0d897fa08be543dfb3214ba.tar.gz |
Update Encode to CPAN version 2.94
[DELTA]
$Revision: 2.94 $ $Date: 2018/01/09 05:53:00 $
! lib/Encode/Alias.pm
Fixed: deep recursion in Encode::find_encoding when decoding
bad MIME header
https://github.com/dankogai/p5-encode/pull/127
! Encode.pm
Pulled: Include more information about Encode::is_utf8() that it
should not be normally used
https://github.com/dankogai/p5-encode/pull/126
Pulled: Remove misleading documentation about UTF8 flag
https://github.com/dankogai/p5-encode/pull/125
Diffstat (limited to 'cpan/Encode')
-rw-r--r-- | cpan/Encode/Encode.pm | 38 | ||||
-rw-r--r-- | cpan/Encode/Makefile.PL | 2 | ||||
-rw-r--r-- | cpan/Encode/lib/Encode/Alias.pm | 4 | ||||
-rw-r--r-- | cpan/Encode/t/decode.t | 2 | ||||
-rw-r--r-- | cpan/Encode/t/mime-name.t | 2 |
5 files changed, 14 insertions, 34 deletions
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index 035169c594..249ac6b138 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -1,5 +1,5 @@ # -# $Id: Encode.pm,v 2.93 2017/10/06 22:21:33 dankogai Exp $ +# $Id: Encode.pm,v 2.94 2018/01/09 05:53:00 dankogai Exp dankogai $ # 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: 2.93 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%02d", q$Revision: 2.94 $ =~ /(\d+)/g; require XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); } @@ -949,38 +949,11 @@ different kinds of strings and string-operations in Perl: one a byte-oriented mode for when the internal UTF8 flag is off, and the other a character-oriented mode for when the internal UTF8 flag is on. -Here is how C<Encode> handles the UTF8 flag. - -=over 2 - -=item * - -When you I<encode>, the resulting UTF8 flag is always B<off>. - -=item * - -When you I<decode>, the resulting UTF8 flag is B<on>--I<unless> you can -unambiguously represent data. Here is what we mean by "unambiguously". -After C<$str = decode("foo", $octet)>, - - When $octet is... The UTF8 flag in $str is - --------------------------------------------- - In ASCII only (or EBCDIC only) OFF - In ISO-8859-1 ON - In any other Encoding ON - --------------------------------------------- - -As you see, there is one exception: in ASCII. That way you can assume -Goal #1. And with C<Encode>, Goal #2 is assumed but you still have to be -careful in the cases mentioned in the B<CAVEAT> paragraphs above. - This UTF8 flag is not visible in Perl scripts, exactly for the same reason you cannot (or rather, you I<don't have to>) see whether a scalar contains a string, an integer, or a floating-point number. But you can still peek and poke these if you will. See the next section. -=back - =head2 Messing with Perl's Internals The following API uses parts of Perl's internals in the current @@ -995,6 +968,13 @@ release. If I<CHECK> is true, also checks whether I<STRING> contains well-formed UTF-8. Returns true if successful, false otherwise. +Typically only necessary for debugging and testing. Don't use this flag as +a marker to distinguish character and binary data, that should be decided +for each variable when you write your code. + +B<CAVEAT>: If I<STRING> has UTF8 flag set, it does B<NOT> mean that +I<STRING> is UTF-8 encoded and vice-versa. + As of Perl 5.8.1, L<utf8> also has the C<utf8::is_utf8> function. =head3 _utf8_on diff --git a/cpan/Encode/Makefile.PL b/cpan/Encode/Makefile.PL index b52ad6c102..8c20d20226 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 dankogai $ +# $Id: Makefile.PL,v 2.22 2017/10/06 22:21:53 dankogai Exp $ # use 5.007003; use strict; diff --git a/cpan/Encode/lib/Encode/Alias.pm b/cpan/Encode/lib/Encode/Alias.pm index 6dcd112a40..dbfa01b618 100644 --- a/cpan/Encode/lib/Encode/Alias.pm +++ b/cpan/Encode/lib/Encode/Alias.pm @@ -1,7 +1,7 @@ package Encode::Alias; use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.23 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.24 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; use Exporter 'import'; @@ -270,7 +270,7 @@ sub init_aliases { define_alias( qr/\bUTF-8$/i => '"utf-8-strict"' ); # At last, Map white space and _ to '-' - define_alias( qr/^(\S+)[\s_]+(.*)$/i => '"$1-$2"' ); + define_alias( qr/^([^\s_]+)[\s_]+([^\s_]*)$/i => '"$1-$2"' ); } 1; diff --git a/cpan/Encode/t/decode.t b/cpan/Encode/t/decode.t index 0cc6c87644..93c992cf54 100644 --- a/cpan/Encode/t/decode.t +++ b/cpan/Encode/t/decode.t @@ -1,5 +1,5 @@ # -# $Id: decode.t,v 1.4 2017/10/06 22:21:53 dankogai Exp dankogai $ +# $Id: decode.t,v 1.4 2017/10/06 22:21:53 dankogai Exp $ # use strict; use Encode qw(decode_utf8 FB_CROAK find_encoding decode); diff --git a/cpan/Encode/t/mime-name.t b/cpan/Encode/t/mime-name.t index 46bd4bf96b..cec86c0362 100644 --- a/cpan/Encode/t/mime-name.t +++ b/cpan/Encode/t/mime-name.t @@ -1,5 +1,5 @@ # -# $Id: mime-name.t,v 1.3 2017/10/06 22:21:53 dankogai Exp dankogai $ +# $Id: mime-name.t,v 1.3 2017/10/06 22:21:53 dankogai Exp $ # This script is written in utf8 # BEGIN { |