summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Vincent <jesse@bestpractical.com>2009-11-16 10:20:27 -0500
committerJesse Vincent <jesse@bestpractical.com>2009-11-16 10:20:27 -0500
commitb2deda172989adc48a591cc4a4c1a88918c73105 (patch)
treeae7e0792d58ff27cd5d55cafdc9bb6435d068290
parentb65597cb4d6f7ba547ab80880fc66b31b6f08c15 (diff)
downloadperl-b2deda172989adc48a591cc4a4c1a88918c73105.tar.gz
Updated Encode to CPAN release 2.38
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/Encode/AUTHORS4
-rw-r--r--cpan/Encode/Byte/Byte.pm4
-rw-r--r--cpan/Encode/CN/CN.pm8
-rw-r--r--cpan/Encode/Changes29
-rw-r--r--cpan/Encode/Encode.pm4
-rw-r--r--cpan/Encode/Encode.xs32
-rw-r--r--cpan/Encode/JP/JP.pm8
-rw-r--r--cpan/Encode/KR/KR.pm8
-rw-r--r--cpan/Encode/META.yml4
-rw-r--r--cpan/Encode/TW/TW.pm8
-rw-r--r--cpan/Encode/Unicode/Unicode.pm4
-rw-r--r--cpan/Encode/Unicode/Unicode.xs4
-rwxr-xr-x[-rw-r--r--]cpan/Encode/bin/enc2xs4
-rwxr-xr-x[-rw-r--r--]cpan/Encode/bin/piconv0
-rwxr-xr-x[-rw-r--r--]cpan/Encode/bin/ucm2table0
-rwxr-xr-x[-rw-r--r--]cpan/Encode/bin/ucmsort0
-rwxr-xr-x[-rw-r--r--]cpan/Encode/bin/unidump0
-rw-r--r--cpan/Encode/lib/Encode/Supported.pod8
-rw-r--r--cpan/Encode/t/CJKT.t4
-rw-r--r--cpan/Encode/t/Unicode.t36
-rw-r--r--cpan/Encode/t/guess.t4
-rw-r--r--cpan/Encode/t/perlio.t4
-rw-r--r--cpan/Encode/t/piconv.t22
24 files changed, 135 insertions, 66 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index e3bf443082..e5db2eb5a8 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -521,7 +521,7 @@ use File::Glob qw(:case);
'Encode' =>
{
'MAINTAINER' => 'dankogai',
- 'DISTRIBUTION' => 'DANKOGAI/Encode-2.37.tar.gz',
+ 'DISTRIBUTION' => 'DANKOGAI/Encode-2.38.tar.gz',
'FILES' => q[cpan/Encode],
'CPAN' => 1,
'UPSTREAM' => undef,
diff --git a/cpan/Encode/AUTHORS b/cpan/Encode/AUTHORS
index 71e1cc3c7a..a470e57f65 100644
--- a/cpan/Encode/AUTHORS
+++ b/cpan/Encode/AUTHORS
@@ -17,14 +17,15 @@ Benjamin Goldberg <goldbb2@earthlink.net>
Bjoern Hoehrmann <derhoermi@gmx.net>
Bjoern Jacke <debianbugs@j3e.de>
Chris Nandor <pudge@pobox.com>
-Curtis Jewell <csjewell@cpan.org>
Craig A. Berry <craigberry@mac.com>
+Curtis Jewell <csjewell@cpan.org>
Dan Kogai <dankogai@dan.co.jp>
Dave Evans <dave@rudolf.org.uk>
Deng Liu <dengliu@ntu.edu.tw>
Dominic Dunlop <domo@computer.org>
Elizabeth Mattijsen <liz@dijkmat.nl>
Gerrit P. Haase <gp@familiehaase.de>
+Gisle Aas <gisle@ActiveState.com>
Graham Barr <gbarr@pobox.com>
Gurusamy Sarathy <gsar@activestate.com>
H.Merijn Brand <h.m.brand@xs4all.nl>
@@ -59,5 +60,6 @@ Steve Hay <steve.hay@uk.radan.com>
Steve Peters <steve@fisharerojo.org>
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
Tels <perl_dummy@bloodgate.com>
+Tony Cook <tony@develop-help.com>
Vadim Konovalov <vkonovalov@peterstar.ru>
Yitzchak Scott-Thoennes <sthoenna@efn.org>
diff --git a/cpan/Encode/Byte/Byte.pm b/cpan/Encode/Byte/Byte.pm
index 3ea9035b7b..d105aa27cc 100644
--- a/cpan/Encode/Byte/Byte.pm
+++ b/cpan/Encode/Byte/Byte.pm
@@ -2,7 +2,7 @@ package Encode::Byte;
use strict;
use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -55,7 +55,7 @@ supported are as follows.
viscii
# all cp* are also available as ibm-*, ms-*, and windows-*
- # also see L<http://msdn.microsoft.com/workshop/author/dhtml/reference/charsets/charset4.asp>
+ # also see L<http://msdn.microsoft.com/en-us/library/aa752010%28VS.85%29.aspx>
cp424
cp437
diff --git a/cpan/Encode/CN/CN.pm b/cpan/Encode/CN/CN.pm
index 9f120fb7f1..830f34507d 100644
--- a/cpan/Encode/CN/CN.pm
+++ b/cpan/Encode/CN/CN.pm
@@ -7,7 +7,7 @@ BEGIN {
use strict;
use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -65,11 +65,7 @@ mean C<euc-cn> encodings. To fix that, C<gb2312> is aliased to C<euc-cn>.
Use C<gb2312-raw> when you really mean it.
The ASCII region (0x00-0x7f) is preserved for all encodings, even though
-this conflicts with mappings by the Unicode Consortium. See
-
-L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
-
-to find out why it is implemented that way.
+this conflicts with mappings by the Unicode Consortium.
=head1 SEE ALSO
diff --git a/cpan/Encode/Changes b/cpan/Encode/Changes
index dcd738410b..6c045f7262 100644
--- a/cpan/Encode/Changes
+++ b/cpan/Encode/Changes
@@ -1,12 +1,33 @@
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.37 2009/09/06 14:32:21 dankogai Exp dankogai $
-$Revision: 2.37 $ $Date: 2009/09/06 14:32:21 $
+# $Id: Changes,v 2.38 2009/11/16 14:08:13 dankogai Exp dankogai $
+$Revision: 2.38 $ $Date: 2009/11/16 14:08:13 $
+! Encode.xs
+ Addressed: Encode memory corruption [perl #70528]
+ Message-Id: <alpine.LFD.2.00.0911152328070.9483@ein.m-l.org>
+! t/Unicode.t Unicode/Unicode.xs
+ Patched: #51263: set magic is not applied when modifying encode arguments
+ http://rt.cpan.org/Ticket/Display.html?id=51263
+! Encode.xs
+ Patched: #51204: Callback CHECK not supported for UTF-8 decoder/encoder
+ http://rt.cpan.org/Ticket/Display.html?id=51204
+! Byte/Byte.pm CN/CN.pm Changes JP/JP.pm KR/KR.pm TW/TW.pm
+ Unicode/Unicode.pm bin/enc2xs lib/Encode/Supported.pod
+ Fix URLs
+ http://rt.cpan.org/Ticket/Display.html?id=49776
+! t/CJKT.t t/guess.t t/perlio.t t/piconv.t
+ $PERL_CORE trick is now off for perl 5.11 or better.
+ Message-Id: <b77c1dce0909070245s59b294bq8a8a8166e7342793@mail.gmail.com>
+ Message-Id: <E7FADA6C-D5A7-4ECA-BE4C-85911A97677E@dan.co.jp>
+ Message-Id: <20090907154908.GS60303@plum.flirble.org>
+ Message-Id: <20090907161509.GN8057@iabyn.com>
+
+2.37 2009/09/06 14:32:21
! Encode.xs
fixed: compilation failure on compilers not supporting C99
http://rt.cpan.org/Ticket/Display.html?id=49466
-2.37 2009/09/06 09:03:07
+2.36 2009/09/06 09:03:07
! Encode.xs
fixed: 'find_encoding("utf8")->decode(undef)' causes segmentation fault
http://rt.cpan.org/Ticket/Display.html?id=49462
@@ -518,7 +539,7 @@ $Revision: 2.37 $ $Date: 2009/09/06 14:32:21 $
1.99 2003/12/29 02:47:16
! Unicode/Unicode.xs
find_encoding("UTF-16BE")->encode("abc") now null terminates
- http://www.mail-archive.com/perl5-porters@perl.org/msg69766.html
+ http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-10/threads.html#00258
! Encode.pm
prototype bug in decode_utf8() fixed
Message-Id: <600A4CDA-F004-11D7-B570-000393AE4244@dan.co.jp>
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
index 749c8f9704..267642c29f 100644
--- a/cpan/Encode/Encode.pm
+++ b/cpan/Encode/Encode.pm
@@ -1,10 +1,10 @@
#
-# $Id: Encode.pm,v 2.37 2009/09/06 14:30:32 dankogai Exp $
+# $Id: Encode.pm,v 2.38 2009/11/16 14:08:01 dankogai Exp $
#
package Encode;
use strict;
use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.37 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.38 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index e5f4c9a32d..5b8d84c25f 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Encode.xs,v 2.16 2009/09/06 14:32:21 dankogai Exp dankogai $
+ $Id: Encode.xs,v 2.17 2009/11/16 14:08:13 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -68,7 +68,7 @@ do_fallback_cb(pTHX_ UV ch, SV *fallback_cb)
{
dSP;
int argc;
- SV *temp, *retval;
+ SV *retval = newSVpv("",0);
ENTER;
SAVETMPS;
PUSHMARK(sp);
@@ -79,13 +79,10 @@ do_fallback_cb(pTHX_ UV ch, SV *fallback_cb)
if (argc != 1){
croak("fallback sub must return scalar!");
}
- temp = newSVsv(POPs);
+ sv_catsv(retval, POPs);
PUTBACK;
FREETMPS;
LEAVE;
- retval = newSVpv("",0);
- sv_catsv(retval, temp);
- SvREFCNT_dec(temp);
return retval;
}
@@ -199,6 +196,7 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src,
: newSVpvf(check & ENCODE_PERLQQ ? "\\x{%04"UVxf"}" :
check & ENCODE_HTMLCREF ? "&#%" UVuf ";" :
"&#x%" UVxf ";", (UV)ch);
+ SvUTF8_off(subchar); /* make sure no decoded string gets in */
sdone += slen + clen;
ddone += dlen + SvCUR(subchar);
sv_catsv(dst, subchar);
@@ -401,19 +399,26 @@ MODULE = Encode PACKAGE = Encode::utf8 PREFIX = Method_
PROTOTYPES: DISABLE
void
-Method_decode_xs(obj,src,check = 0)
+Method_decode_xs(obj,src,check_sv = &PL_sv_no)
SV * obj
SV * src
-int check
+SV * check_sv
PREINIT:
STRLEN slen;
U8 *s;
U8 *e;
SV *dst;
bool renewed = 0;
+ int check;
CODE:
{
dSP; ENTER; SAVETMPS;
+ if (SvROK(check_sv)) {
+ croak("UTF-8 decoder doesn't support callback CHECK");
+ }
+ else {
+ check = SvIV(check_sv);
+ }
if (src == &PL_sv_undef) src = newSV(0);
s = (U8 *) SvPV(src, slen);
e = (U8 *) SvEND(src);
@@ -464,18 +469,25 @@ CODE:
}
void
-Method_encode_xs(obj,src,check = 0)
+Method_encode_xs(obj,src,check_sv = &PL_sv_no)
SV * obj
SV * src
-int check
+SV * check_sv
PREINIT:
STRLEN slen;
U8 *s;
U8 *e;
SV *dst;
bool renewed = 0;
+ int check;
CODE:
{
+ if (SvROK(check_sv)) {
+ croak("UTF-8 encoder doesn't support callback CHECK");
+ }
+ else {
+ check = SvIV(check_sv);
+ }
if (src == &PL_sv_undef) src = newSV(0);
s = (U8 *) SvPV(src, slen);
e = (U8 *) SvEND(src);
diff --git a/cpan/Encode/JP/JP.pm b/cpan/Encode/JP/JP.pm
index e78e54d052..4251170c56 100644
--- a/cpan/Encode/JP/JP.pm
+++ b/cpan/Encode/JP/JP.pm
@@ -7,7 +7,7 @@ BEGIN {
use strict;
use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -86,11 +86,7 @@ in order to preserve text layout as much as possible.
=head1 BUGS
The ASCII region (0x00-0x7f) is preserved for all encodings, even
-though this conflicts with mappings by the Unicode Consortium. See
-
-L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
-
-to find out why it is implemented that way.
+though this conflicts with mappings by the Unicode Consortium.
=head1 SEE ALSO
diff --git a/cpan/Encode/KR/KR.pm b/cpan/Encode/KR/KR.pm
index 8cb2c63b16..cf2c1174e4 100644
--- a/cpan/Encode/KR/KR.pm
+++ b/cpan/Encode/KR/KR.pm
@@ -7,7 +7,7 @@ BEGIN {
use strict;
use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -60,11 +60,7 @@ mean "cp949" encodings. To fix that, the following aliases are set;
qr/ks_c_5601-1987$/i => '"cp949"'
The ASCII region (0x00-0x7f) is preserved for all encodings, even
-though this conflicts with mappings by the Unicode Consortium. See
-
-L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
-
-to find out why it is implemented that way.
+though this conflicts with mappings by the Unicode Consortium.
=head1 SEE ALSO
diff --git a/cpan/Encode/META.yml b/cpan/Encode/META.yml
index 85a3cd0d8b..70090afc02 100644
--- a/cpan/Encode/META.yml
+++ b/cpan/Encode/META.yml
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Encode
-version: 2.37
+version: 2.38
abstract: ~
author: []
license: unknown
@@ -14,7 +14,7 @@ no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.54
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
diff --git a/cpan/Encode/TW/TW.pm b/cpan/Encode/TW/TW.pm
index ffaa844204..c30499bee1 100644
--- a/cpan/Encode/TW/TW.pm
+++ b/cpan/Encode/TW/TW.pm
@@ -7,7 +7,7 @@ BEGIN {
use strict;
use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -66,11 +66,7 @@ manipulation, please use C<EUC-TW> in L<Encode::HanExtra>, which contains
planes 1-7.
The ASCII region (0x00-0x7f) is preserved for all encodings, even
-though this conflicts with mappings by the Unicode Consortium. See
-
-L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
-
-to find out why it is implemented that way.
+though this conflicts with mappings by the Unicode Consortium.
=head1 SEE ALSO
diff --git a/cpan/Encode/Unicode/Unicode.pm b/cpan/Encode/Unicode/Unicode.pm
index 16982bbb16..f71567c619 100644
--- a/cpan/Encode/Unicode/Unicode.pm
+++ b/cpan/Encode/Unicode/Unicode.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
no warnings 'redefine';
-our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@ -259,7 +259,7 @@ Consider that "division by zero" of Encode :)
L<Encode>, L<Encode::Unicode::UTF7>, L<http://www.unicode.org/glossary/>,
L<http://www.unicode.org/unicode/faq/utf_bom.html>,
-RFC 2781 L<http://rfc.net/rfc2781.html>,
+RFC 2781 L<http://www.ietf.org/rfc/rfc2781.txt>,
The whole Unicode standard L<http://www.unicode.org/unicode/uni2book/u2.html>
diff --git a/cpan/Encode/Unicode/Unicode.xs b/cpan/Encode/Unicode/Unicode.xs
index 1f041d4240..d8ef569515 100644
--- a/cpan/Encode/Unicode/Unicode.xs
+++ b/cpan/Encode/Unicode/Unicode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Unicode.xs,v 2.5 2009/02/01 13:14:41 dankogai Exp $
+ $Id: Unicode.xs,v 2.6 2009/11/16 14:08:13 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -377,5 +377,7 @@ CODE:
if (!temp_result)
shrink_buffer(result);
+ SvSETMAGIC(utf8);
+
XSRETURN(1);
}
diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
index 233ca546e7..773c0a09fb 100644..100755
--- a/cpan/Encode/bin/enc2xs
+++ b/cpan/Encode/bin/enc2xs
@@ -10,7 +10,7 @@ use warnings;
use Getopt::Std;
use Config;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 2.6 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.7 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
@@ -1356,7 +1356,7 @@ L<http://www.icu-project.org/>
=item *
ICU Character Mapping Tables
-L<http://www.icu-project.org/charset/>
+L<http://site.icu-project.org/charts/charset>
=item *
diff --git a/cpan/Encode/bin/piconv b/cpan/Encode/bin/piconv
index 9fdebd193c..9fdebd193c 100644..100755
--- a/cpan/Encode/bin/piconv
+++ b/cpan/Encode/bin/piconv
diff --git a/cpan/Encode/bin/ucm2table b/cpan/Encode/bin/ucm2table
index 66e63fcdb9..66e63fcdb9 100644..100755
--- a/cpan/Encode/bin/ucm2table
+++ b/cpan/Encode/bin/ucm2table
diff --git a/cpan/Encode/bin/ucmsort b/cpan/Encode/bin/ucmsort
index 3e037dc02b..3e037dc02b 100644..100755
--- a/cpan/Encode/bin/ucmsort
+++ b/cpan/Encode/bin/ucmsort
diff --git a/cpan/Encode/bin/unidump b/cpan/Encode/bin/unidump
index ae0da30852..ae0da30852 100644..100755
--- a/cpan/Encode/bin/unidump
+++ b/cpan/Encode/bin/unidump
diff --git a/cpan/Encode/lib/Encode/Supported.pod b/cpan/Encode/lib/Encode/Supported.pod
index 431bb7750b..e84faafd9e 100644
--- a/cpan/Encode/lib/Encode/Supported.pod
+++ b/cpan/Encode/lib/Encode/Supported.pod
@@ -589,7 +589,7 @@ for example)
it is beyond the power of words to describe the way HTML browsers
encode non-C<ASCII> form data. To get a general impression, visit
-L<http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html>.
+L<http://www.alanflavell.org.uk/charset/form-i18n.html>.
While encoding of form data has stabilized for C<UTF-8> encoded pages
(at least IE 5/6, NS 6, and Opera 6 behave consistently), be sure to
expect fun (and cross-browser discrepancies) with C<UTF-16> encoded
@@ -817,7 +817,7 @@ L<http://www.iso.ch/>
=item RFC
Request For Comments -- need I say more?
-L<http://www.rfc-editor.org/>, L<http://www.rfc.net/>,
+L<http://www.rfc-editor.org/>, L<http://www.ietf.org/rfc.html>,
L<http://www.faqs.org/rfcs/>
=item UC
@@ -850,7 +850,7 @@ vs. vendor mappings.
=item CJK.inf
-L<http://www.oreilly.com/people/authors/lunde/cjk_inf.html>
+L<http://examples.oreilly.com/cjkvinfo/doc/cjk.inf>
Somewhat obsolete (last update in 1996), but still useful. Also try
@@ -893,7 +893,7 @@ to better support CJKV languages/scripts in all the areas of
information processing.
To purchase this book, visit
-L<http://www.oreilly.com/catalog/cjkvinfo/>
+L<http://oreilly.com/catalog/9780596514471/>
or your favourite bookstore.
=back
diff --git a/cpan/Encode/t/CJKT.t b/cpan/Encode/t/CJKT.t
index 1648b1e5fd..8866f75aa8 100644
--- a/cpan/Encode/t/CJKT.t
+++ b/cpan/Encode/t/CJKT.t
@@ -1,4 +1,8 @@
BEGIN {
+ if ( $ENV{'PERL_CORE'} && $] >= 5.011) {
+ chdir 't';
+ unshift @INC, '../lib';
+ }
require Config; import Config;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
diff --git a/cpan/Encode/t/Unicode.t b/cpan/Encode/t/Unicode.t
index aa80899ab3..d6dd1ec1b9 100644
--- a/cpan/Encode/t/Unicode.t
+++ b/cpan/Encode/t/Unicode.t
@@ -1,5 +1,5 @@
#
-# $Id: Unicode.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $
+# $Id: Unicode.t,v 2.2 2009/11/16 14:08:13 dankogai Exp dankogai $
#
# This script is written entirely in ASCII, even though quoted literals
# do include non-BMP unicode characters -- Are you happy, jhi?
@@ -20,8 +20,8 @@ BEGIN {
use strict;
#use Test::More 'no_plan';
-use Test::More tests => 37;
-use Encode qw(encode decode);
+use Test::More tests => 38;
+use Encode qw(encode decode find_encoding);
#
# see
@@ -131,5 +131,35 @@ for my $file (@file){
is(decode("UTF-7", encode("UTF-7", $content)), $content,
"UTF-7 RT:$file");
}
+
+# Magic
+{
+ # see http://rt.perl.org/rt3//Ticket/Display.html?id=60472
+ my $work = chr(0x100);
+ my $encoding = find_encoding("UTF16-BE");
+ my $tied;
+ tie $tied, SomeScalar => \$work;
+ my $result = $encoding->encode($tied, 1);
+ is($work, "", "check set magic was applied");
+}
+
+package SomeScalar;
+use Tie::Scalar;
+use vars qw(@ISA);
+BEGIN { @ISA = 'Tie::Scalar' }
+
+sub TIESCALAR {
+ my ($class, $ref) = @_;
+ return bless $ref, $class;
+}
+
+sub FETCH {
+ ${$_[0]}
+}
+
+sub STORE {
+ ${$_[0]} = $_[1];
+}
+
1;
__END__
diff --git a/cpan/Encode/t/guess.t b/cpan/Encode/t/guess.t
index 37ddd5a0b1..514ecac7b4 100644
--- a/cpan/Encode/t/guess.t
+++ b/cpan/Encode/t/guess.t
@@ -1,4 +1,8 @@
BEGIN {
+ if ( $ENV{'PERL_CORE'} && $] >= 5.011) {
+ chdir 't';
+ unshift @INC, '../lib';
+ }
require Config; import Config;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
diff --git a/cpan/Encode/t/perlio.t b/cpan/Encode/t/perlio.t
index e50dfa4d73..2dee60d132 100644
--- a/cpan/Encode/t/perlio.t
+++ b/cpan/Encode/t/perlio.t
@@ -1,4 +1,8 @@
BEGIN {
+ if ( $ENV{'PERL_CORE'} && $] >= 5.011) {
+ chdir 't';
+ unshift @INC, '../lib';
+ }
require Config; import Config;
if ($Config{'extensions'} !~ /\bEncode\b/) {
print "1..0 # Skip: Encode was not built\n";
diff --git a/cpan/Encode/t/piconv.t b/cpan/Encode/t/piconv.t
index b24d753899..ee8a8149f8 100644
--- a/cpan/Encode/t/piconv.t
+++ b/cpan/Encode/t/piconv.t
@@ -1,20 +1,26 @@
#
-# $Id: piconv.t,v 0.2 2009/07/13 00:50:52 dankogai Exp $
+# $Id: piconv.t,v 0.3 2009/11/16 14:08:13 dankogai Exp dankogai $
#
+BEGIN {
+ if ( $ENV{'PERL_CORE'} && $] >= 5.011) {
+ print "1..0 # Skip: Don't know how to test this within perl's core\n";
+ exit 0;
+ }
+}
+
use strict;
-use Config;
use FindBin;
use File::Spec;
use IPC::Open3 qw(open3);
use IO::Select;
use Test::More;
-my $nofork = ! $Config{d_fork};
+my $WIN = $^O eq 'MSWin32';
-if ($nofork) {
+if ($WIN) {
eval { require IPC::Run; IPC::Run->VERSION(0.83); 1; } or
- plan skip_all => 'Without fork(), we require IPC::Run 0.83 to complete this test';
+ plan skip_all => 'Win32 environments require IPC::Run 0.83 to complete this test';
}
sub run_cmd (;$$);
@@ -23,14 +29,14 @@ my $blib =
File::Spec->rel2abs(
File::Spec->catdir( $FindBin::RealBin, File::Spec->updir, 'blib' ) );
my $script = File::Spec->catdir($blib, 'script', 'piconv');
-my @base_cmd = ( $^X, ($ENV{PERL_CORE} ? () : "-Mblib=$blib"), $script );
+my @base_cmd = ( $^X, "-Mblib=$blib", $script );
plan tests => 5;
{
my ( $st, $out, $err ) = run_cmd;
is( $st, 0, 'status for usage call' );
- is( $out, $nofork ? undef : '' );
+ is( $out, $WIN ? undef : '' );
like( $err, qr{^piconv}, 'usage' );
}
@@ -52,7 +58,7 @@ sub run_cmd (;$$) {
my $err = "x" x 10_000;
$err = "";
- if ($nofork) {
+ if ($WIN) {
IPC::Run->import(qw(run timeout));
my @cmd;
if (defined $args) {