Projects
openEuler:Mainline
perl-Encode
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:perl-Encode.spec
Changed
@@ -1,8 +1,8 @@ -%global cpan_version 3.16 +%global cpan_version 3.19 Name: perl-Encode Epoch: 4 Version: %{cpan_version} -Release: 2 +Release: 1 Summary: Character encodings in Perl License: (GPL+ or Artistic) and Artistic 2.0 and UCD URL: https://metacpan.org/release/Encode @@ -93,6 +93,9 @@ %{_mandir}/man3/Encode::* %changelog +* Tue Jul 18 2023 leeffo <liweiganga@uniontech.com> - 4:3.19-1 +- upgrade to version 3.19 + * Tue Apr 26 2022 renhognxun <renhongxun@h-partners.com> - 4:3.16-2 - upgrade epoch to 4
View file
_service:tar_scm:Encode-3.16.tar.gz/Changes -> _service:tar_scm:Encode-3.19.tar.gz/Changes
Changed
@@ -1,11 +1,43 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 3.16 2021/10/13 08:29:13 dankogai Exp dankogai $ +# $Id: Changes,v 3.19 2022/08/04 04:43:23 dankogai Exp dankogai $ # -$Revision: 3.16 $ $Date: 2021/10/13 08:29:13 $ +$Revision: 3.19 $ $Date: 2022/08/04 04:43:23 $ +! lib/Encode/Alias.pm /t/Aliases.t + Add ISO-8859-8-I as an alias of ISO-8859-8 + <8ac3918e-5d77-4815-f1e6-6577397068c6@iki.fi> + https://en.wikipedia.org/wiki/ISO-8859-8-I + +3.18 2022/06/25 02:05:01 +! lib/Encode/MIME/Header.pm t/mime-header.t + Pulled: Encode::MIME::Header: Fix base64 word decoding + https://github.com/dankogai/p5-encode/pull/169 +! t/Unicode_trailing_nul.t t/truncated_utf8.t + t/utf32warnings.t t/xml.t + Skip so Github Actions are happy + https://github.com/dankogai/p5-encode/blob/main/.github/workflows/versions.yml + +3.17 2022/04/07 03:06:40 +! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t + Pulled: Fix Issue #144, spurious warnings from -Wc++-compate, + and a few related nits + https://github.com/dankogai/p5-encode/pull/168 +! MANIFEST + add t/utf32warnings.t which was missing +! t/taint.t + Pulled: Skip taint tests if your perl was built without taint support + https://github.com/dankogai/p5-encode/pull/167 +! Unicode/Unicode.pm + Pulled: fix link to Unicode standard + https://github.com/dankogai/p5-encode/pull/165 +! t/Unicode_trailing_nul.t + Pulled: Use note() instead of diag() + https://github.com/dankogai/p5-encode/pull/164 + +3.16 2021/10/13 08:29:13 ! Makefile.PL Pulled: Only add -Werror=declaration-after-statement for 5.035004 and earlier - https://github.com/dankogai/p5-encode/pull/162/filehttps://github.com/dankogai/p5-encode/pull/162 + https://github.com/dankogai/p5-encode/pull/162 3.15 2021/10/08 15:29:23 ! Encode.xs
View file
_service:tar_scm:Encode-3.16.tar.gz/Encode.pm -> _service:tar_scm:Encode-3.19.tar.gz/Encode.pm
Changed
@@ -1,5 +1,5 @@ # -# $Id: Encode.pm,v 3.16 2021/10/13 08:29:04 dankogai Exp $ +# $Id: Encode.pm,v 3.19 2022/08/04 04:42:30 dankogai Exp $ # package Encode; use strict; @@ -7,7 +7,7 @@ use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; our $VERSION; BEGIN { - $VERSION = sprintf "%d.%02d", q$Revision: 3.16 $ =~ /(\d+)/g; + $VERSION = sprintf "%d.%02d", q$Revision: 3.19 $ =~ /(\d+)/g; require XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); }
View file
_service:tar_scm:Encode-3.16.tar.gz/MANIFEST -> _service:tar_scm:Encode-3.19.tar.gz/MANIFEST
Changed
@@ -112,6 +112,7 @@ t/undef.t test script t/unibench.pl benchmark script t/use-Encode-Alias.t test script +t/utf32warnings.t test script t/utf8ref.t test script t/utf8strict.t test script t/utf8warnings.t test script
View file
_service:tar_scm:Encode-3.16.tar.gz/META.json -> _service:tar_scm:Encode-3.19.tar.gz/META.json
Changed
@@ -4,7 +4,7 @@ "Dan Kogai <dankogai@dan.co.jp>" , "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010", "license" : "perl_5" , @@ -49,7 +49,7 @@ "url" : "https://github.com/dankogai/p5-encode" } }, - "version" : "3.16", + "version" : "3.19", "x_contributors" : "Alex Davies <alex.davies@talktalk.net>", "Alex Kapranoff <alex@kapranoff.ru>", @@ -135,5 +135,5 @@ "Vincent van Dam <vvandam@sandvine.com>", "Yitzchak Scott-Thoennes <sthoenna@efn.org>" , - "x_serialization_backend" : "JSON::PP version 4.06" + "x_serialization_backend" : "JSON::PP version 4.07" }
View file
_service:tar_scm:Encode-3.16.tar.gz/META.yml -> _service:tar_scm:Encode-3.19.tar.gz/META.yml
Changed
@@ -8,7 +8,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,7 +24,7 @@ parent: '0.221' resources: repository: https://github.com/dankogai/p5-encode -version: '3.16' +version: '3.19' x_contributors: - 'Alex Davies <alex.davies@talktalk.net>' - 'Alex Kapranoff <alex@kapranoff.ru>'
View file
_service:tar_scm:Encode-3.16.tar.gz/Makefile.PL -> _service:tar_scm:Encode-3.19.tar.gz/Makefile.PL
Changed
@@ -1,5 +1,5 @@ # -# $Id: Makefile.PL,v 2.24 2021/10/13 08:29:13 dankogai Exp dankogai $ +# $Id: Makefile.PL,v 2.25 2022/06/25 01:58:57 dankogai Exp $ # use 5.007003; use strict; @@ -17,6 +17,8 @@ my $ccflags = $Config{ccflags}; if (!$ENV{PERL_CORE}) { if (my $gccver = $Config{gccversion}) { + # no more 'Argument "Apple" isn't numeric in addition (+)' + no warnings 'numeric'; $gccver =~ s/\.//g; $gccver =~ s/ .*//; $gccver .= "0" while length $gccver < 3; $gccver = 0+$gccver;
View file
_service:tar_scm:Encode-3.16.tar.gz/Unicode/Unicode.pm -> _service:tar_scm:Encode-3.19.tar.gz/Unicode/Unicode.pm
Changed
@@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.19 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.20 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -170,7 +170,7 @@ When BE or LE is omitted during decode(), it checks if BOM is at the beginning of the string; if one is found, the endianness is set to -what the BOM says. +what the BOM says. =item * @@ -258,15 +258,15 @@ =head1 SEE ALSO -L<Encode>, L<Encode::Unicode::UTF7>, L<http://www.unicode.org/glossary/>, -L<http://www.unicode.org/faq/utf_bom.html>, +L<Encode>, L<Encode::Unicode::UTF7>, L<https://www.unicode.org/glossary/>, +L<https://www.unicode.org/faq/utf_bom.html>, RFC 2781 L<http://www.ietf.org/rfc/rfc2781.txt>, -The whole Unicode standard L<http://www.unicode.org/unicode/uni2book/u2.html> +The whole Unicode standard L<https://www.unicode.org/standard/standard.html> -Ch. 15, pp. 403 of C<Programming Perl (3rd Edition)> -by Larry Wall, Tom Christiansen, Jon Orwant; -O'Reilly & Associates; ISBN 0-596-00027-8 +Ch. 6 pp. 275 of C<Programming Perl (3rd Edition)> +by Tom Christiansen, brian d foy & Larry Wall; +O'Reilly & Associates; ISBN 978-0-596-00492-7 =cut
View file
_service:tar_scm:Encode-3.16.tar.gz/bin/enc2xs -> _service:tar_scm:Encode-3.19.tar.gz/bin/enc2xs
Changed
@@ -11,7 +11,7 @@ use Getopt::Std; use Config; my @orig_ARGV = @ARGV; -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 }; # These may get re-ordered. # RAW is a do_now as inserted by &enter @@ -249,7 +249,12 @@ END } - if ($cname =~ /(\w+)\.xs$/) + if ($cname =~ /\.c$/i && $Config{ccname} eq "gcc") + { + print C qq(#pragma GCC diagnostic ignored "-Wc++-compat"\n); + } + + if ($cname =~ /\.xs$/i) { print C "#define PERL_NO_GET_CONTEXT\n"; print C "#include <EXTERN.h>\n"; @@ -259,15 +264,15 @@ print C "#include \"encode.h\"\n\n"; } -elsif ($cname =~ /\.enc$/) +elsif ($cname =~ /\.enc$/i) { $doEnc = 1; } -elsif ($cname =~ /\.ucm$/) +elsif ($cname =~ /\.ucm$/i) { $doUcm = 1; } -elsif ($cname =~ /\.pet$/) +elsif ($cname =~ /\.pet$/i) { $doPet = 1; }
View file
_service:tar_scm:Encode-3.16.tar.gz/lib/Encode/Alias.pm -> _service:tar_scm:Encode-3.19.tar.gz/lib/Encode/Alias.pm
Changed
@@ -1,7 +1,7 @@ package Encode::Alias; use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.24 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.25 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; use Exporter 'import'; @@ -162,6 +162,10 @@ # Allow variants of iso-8859-1 etc. define_alias( qr/\biso-_?(\d+)-_(\d+)$/i => '"iso-$1-$2"' ); + # ISO-8859-8-I => ISO-8859-8 + # https://en.wikipedia.org/wiki/ISO-8859-8-I + define_alias( qr/\biso-_8859-_8-_I$/i => '"iso-8859-8"' ); + # At least HP-UX has these. define_alias( qr/\biso8859(\d+)$/i => '"iso-8859-$1"' );
View file
_service:tar_scm:Encode-3.16.tar.gz/lib/Encode/MIME/Header.pm -> _service:tar_scm:Encode-3.19.tar.gz/lib/Encode/MIME/Header.pm
Changed
@@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = do { my @r = ( q$Revision: 2.28 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.29 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use Carp (); use Encode (); @@ -55,7 +55,7 @@ # in strict mode check also for valid base64 characters and also for valid quoted printable codes my $re_encoding_strict_b = qr/Bb/; my $re_encoding_strict_q = qr/Qq/; -my $re_encoded_text_strict_b = qr/0-9A-Za-z\+\/*={0,2}/; +my $re_encoded_text_strict_b = qr/(?:0-9A-Za-z\+\/{4})*(?:0-9A-Za-z\+\/{2}==|0-9A-Za-z\+\/{3}=|)/; my $re_encoded_text_strict_q = qr/(?:\x21-\x3C\x3E\x40-\x7E|=0-9A-Fa-f{2})*/; # NOTE: first part are printable US-ASCII except ?, =, SPACE and TAB my $re_encoded_word_strict = qr/=\?$re_charset(?:\*$re_language)?\?(?:$re_encoding_strict_b\?$re_encoded_text_strict_b|$re_encoding_strict_q\?$re_encoded_text_strict_q)\?=/; my $re_capture_encoded_word_strict = qr/=\?($re_charset)((?:\*$re_language)?)\?($re_encoding_strict_b\?$re_encoded_text_strict_b|$re_encoding_strict_q\?$re_encoded_text_strict_q)\?=/; @@ -94,6 +94,10 @@ $stop = 1 unless length($line) or length($sep); + # in non strict mode append missing '=' padding characters for b words + # fixes below concatenation of consecutive encoded mime words + 1 while not $STRICT_DECODE and $line =~ s/(=\?$re_charset(?:\*$re_language)?\?Bb\?)((?:^\?{4})*^\?{1,3})(\?=)/$1.$2.('='x(4-length($2)%4)).$3/se; + # NOTE: this code partially could break $chk support # in non strict mode concat consecutive encoded mime words with same charset, language and encoding # fixes breaking inside multi-byte characters
View file
_service:tar_scm:Encode-3.16.tar.gz/t/Aliases.t -> _service:tar_scm:Encode-3.19.tar.gz/t/Aliases.t
Changed
@@ -42,6 +42,7 @@ 'arabic' => 'iso-8859-6', 'greek' => 'iso-8859-7', 'hebrew' => 'iso-8859-8', + 'iso-8859-8-I' => 'iso-8859-8', 'thai' => 'iso-8859-11', 'tis620' => 'iso-8859-11', 'tis-620' => 'iso-8859-11',
View file
_service:tar_scm:Encode-3.16.tar.gz/t/Unicode_trailing_nul.t -> _service:tar_scm:Encode-3.19.tar.gz/t/Unicode_trailing_nul.t
Changed
@@ -1,3 +1,9 @@ +BEGIN { + if ( $ < 5.009 ) { + print "1..0 # Skip: Perl <= 5.9 or later required\n"; + exit 0; + } +} use strict; use Test::More; @@ -12,7 +18,7 @@ my ($fh, $path) = File::Temp::tempfile( CLEANUP => 1 ); -diag "temp file: $path"; +note "temp file: $path"; # Perl gives the internal PV to exec .. which is buggy/wrong but # useful here:
View file
_service:tar_scm:Encode-3.16.tar.gz/t/enc_data.t -> _service:tar_scm:Encode-3.19.tar.gz/t/enc_data.t
Changed
@@ -1,4 +1,4 @@ -# $Id: enc_data.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: enc_data.t,v 2.6 2022/04/07 03:06:40 dankogai Exp $ BEGIN { require Config; import Config; @@ -15,7 +15,7 @@ exit(0); } if ($ >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } if ($ <= 5.008 and !$Config{perl_patchlevel}){
View file
_service:tar_scm:Encode-3.16.tar.gz/t/enc_module.t -> _service:tar_scm:Encode-3.19.tar.gz/t/enc_module.t
Changed
@@ -1,4 +1,4 @@ -# $Id: enc_module.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: enc_module.t,v 2.6 2022/04/07 03:06:40 dankogai Exp $ # This file is in euc-jp BEGIN { require Config; import Config; @@ -19,7 +19,7 @@ exit(0); } if ($ >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } }
View file
_service:tar_scm:Encode-3.16.tar.gz/t/encoding.t -> _service:tar_scm:Encode-3.19.tar.gz/t/encoding.t
Changed
@@ -13,7 +13,7 @@ exit(0); } if ($ >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } }
View file
_service:tar_scm:Encode-3.16.tar.gz/t/jperl.t -> _service:tar_scm:Encode-3.19.tar.gz/t/jperl.t
Changed
@@ -1,5 +1,5 @@ # -# $Id: jperl.t,v 2.5 2016/11/29 23:29:23 dankogai Exp $ +# $Id: jperl.t,v 2.6 2022/04/07 03:06:40 dankogai Exp $ # # This script is written in euc-jp @@ -18,7 +18,7 @@ exit 0; } if ($ >= 5.025 and !$Config{usecperl}) { - print "1..0 # Skip: encoding pragma not supported in Perl 5.26\n"; + print "1..0 # Skip: encoding pragma not supported in Perl 5.25 or later\n"; exit(0); } $| = 1;
View file
_service:tar_scm:Encode-3.16.tar.gz/t/mime-header.t -> _service:tar_scm:Encode-3.19.tar.gz/t/mime-header.t
Changed
@@ -1,5 +1,5 @@ # -# $Id: mime-header.t,v 2.15 2017/07/18 07:15:29 dankogai Exp $ +# $Id: mime-header.t,v 2.16 2022/06/25 01:58:57 dankogai Exp $ # This script is written in utf8 # BEGIN { @@ -24,7 +24,7 @@ use utf8; use charnames ":full"; -use Test::More tests => 266; +use Test::More tests => 274; BEGIN { use_ok("Encode::MIME::Header"); @@ -138,6 +138,11 @@ "=?utf-8-strict?Q?=C3=A1=f9=80=80=80=80?=" => "á�", # allow non-ASCII characters in q word "=?UTF-8?Q?\x{C3}\x{A1}?=" => "á", + # allow missing padding characters '=' in b word + "=?UTF-8?B?JQ?=" => "%", + "=?UTF-8?B?JQ?= =?UTF-8?B?JQ?=" => "%%", + "=?UTF-8?B?YWI?=" => "ab", + "=?UTF-8?B?YWI?= =?UTF-8?B?YWI?=" => "abab", ); my @decode_strict_tests = ( @@ -159,6 +164,11 @@ "=?utf-8-strict?Q?=C3=A1?=" => "=?utf-8-strict?Q?=C3=A1?=", # do not allow non-ASCII characters in q word "=?UTF-8?Q?\x{C3}\x{A1}?=" => "=?UTF-8?Q?\x{C3}\x{A1}?=", + # do not allow missing padding characters '=' in b word + "=?UTF-8?B?JQ?=" => "=?UTF-8?B?JQ?=", + "=?UTF-8?B?JQ?= =?UTF-8?B?JQ?=" => "=?UTF-8?B?JQ?= =?UTF-8?B?JQ?=", + "=?UTF-8?B?YWI?=" => "=?UTF-8?B?YWI?=", + "=?UTF-8?B?YWI?= =?UTF-8?B?YWI?=" => "=?UTF-8?B?YWI?= =?UTF-8?B?YWI?=", ); my @encode_tests = (
View file
_service:tar_scm:Encode-3.16.tar.gz/t/taint.t -> _service:tar_scm:Encode-3.19.tar.gz/t/taint.t
Changed
@@ -4,6 +4,7 @@ local %Encode::ExtModule = %Encode::Config::ExtModule; use Scalar::Util qw(tainted); use Test::More; +use Config; my $taint = substr($ENV{PATH},0,0); my $str = "dan\x{5f3e}" . $taint; # tainted string to encode my $bin = encode('UTF-8', $str); # tainted binary to decode @@ -11,7 +12,12 @@ my $notaint_str = "dan\x{5f3e}" . $notaint; my $notaint_bin = encode('UTF-8', $notaint_str); my @names = Encode->encodings(':all'); -plan tests => 4 * @names + 2; +if (exists($Config{taint_support}) && not $Config{taint_support}) { + plan skip_all => "your perl was built without taint support"; +} +else { + plan tests => 4 * @names + 2; +} for my $name (@names) { my ($d, $e, $s); eval {
View file
_service:tar_scm:Encode-3.16.tar.gz/t/truncated_utf8.t -> _service:tar_scm:Encode-3.19.tar.gz/t/truncated_utf8.t
Changed
@@ -12,6 +12,10 @@ print "1..0 # Skip: EBCDIC\n"; exit 0; } + if ( $ < 5.009 ) { + print "1..0 # Skip: Perl <= 5.9 or later required\n"; + exit 0; + } $| = 1; }
View file
_service:tar_scm:Encode-3.19.tar.gz/t/utf32warnings.t
Added
@@ -0,0 +1,283 @@ +BEGIN { + if ( $ < 5.009 ) { + print "1..0 # Skip: Perl <= 5.9 or later required\n"; + exit 0; + } +} +use strict; +use warnings; + +my $script = quotemeta $0; + +use Encode; +use Test::More tests => 38; + +my $valid = "\x61\x00\x00\x00"; +my $invalid = "\x78\x56\x34\x12"; + +our $warn; +$SIG{__WARN__} = sub { $warn = $_0 }; + +my $enc = find_encoding("UTF32-LE"); + +{ + local $warn; + my $ret = $enc->encode( "a", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling encode on UTF32-LE encode object with valid string produces no warnings"); + is($ret, $valid, "Calling encode on UTF32-LE encode object with valid string returns correct output"); +} + + +{ + local $warn; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling encode on UTF32-LE encode object with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode object cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode object cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = Encode::encode( $enc, "a", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling Encode::encode for UTF32-LE with valid string produces no warnings"); + is($ret, $valid, "Calling Encode::encode for UTF32-LE with valid string returns correct output"); +} + + +{ + local $warn; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling Encode::encode for UTF32-LE with invalid string warns"); +} + + +{ + local $warn; + no warnings 'utf8'; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::encode for UTF32-LE can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::encode for UTF32-LE can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from Encode::encode for UTF32-LE cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/UTF-16 surrogate.* at $script line /, "Warning from Encode::encode for UTF32-LE cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = $enc->decode( $valid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling decode on UTF32-LE encode object with valid string produces no warnings"); + is($ret, "a", "Calling decode on UTF32-LE encode object with valid string returns correct output"); +} + + +{ + local $warn; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Calling decode on UTF32-LE encode object with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from decode method of UTF32-LE encode object can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from decode method of UTF32-LE encode object can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from decode method of UTF32-LE encode object cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + $enc->decode( $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from decode method of UTF32-LE encode object cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +{ + local $warn; + my $ret = Encode::decode( $enc, $valid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Calling Encode::decode for UTF32-LE with valid string produces no warnings"); + is($ret, "a", "Calling Encode::decode for UTF32-LE with valid string returns correct output"); +} + + +{ + local $warn; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Calling Encode::decode for UTF32-LE with invalid string warns"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::decode for UTF32-LE can be silenced via no warnings 'utf8'"); +} + +{ + local $warn; + no warnings; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::ONLY_PRAGMA_WARNINGS | Encode::LEAVE_SRC ); + is($warn, undef, "Warning from Encode::decode for UTF32-LE can be silenced via no warnings"); +} + +{ + local $warn; + no warnings 'utf8'; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from Encode::decode for UTF32-LE cannot be silenced via no warnings 'utf8' when ONLY_PRAGMA_WARNINGS is not used"); +} + +{ + local $warn; + no warnings; + Encode::decode( $enc, $invalid, Encode::WARN_ON_ERR | Encode::LEAVE_SRC ); + like($warn, qr/may not be portable.* at $script line /, "Warning from Encode::decode for UTF32-LE cannot be silenced via no warnings when ONLY_PRAGMA_WARNINGS is not used"); +} + + +use PerlIO::encoding; +$PerlIO::encoding::fallback |= Encode::ONLY_PRAGMA_WARNINGS; + +{
View file
_service:tar_scm:Encode-3.16.tar.gz/t/xml.t -> _service:tar_scm:Encode-3.19.tar.gz/t/xml.t
Changed
@@ -1,3 +1,9 @@ +BEGIN { + if ( $ < 5.009 ) { + print "1..0 # Skip: Perl <= 5.9 or later required\n"; + exit 0; + } +} use strict; use warnings; @@ -8,7 +14,7 @@ my $text = Encode::encode('latin1', $content, Encode::FB_XMLCREF); is $text, "--テ--"; -done_testing; +done_testing(); package String; use overload
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2