From: Rafael Garcia-Suarez Date: Mon, 29 Dec 2003 08:10:51 +0000 (+0000) Subject: Upgrade to Encode 1.99. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2cbba7db7fc4081c5d985a6a15c29dded8e6709;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Encode 1.99. p4raw-id: //depot/perl@21991 --- diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 0ec0702..b034b93 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,8 +1,21 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 1.98 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: Changes,v 1.99 2003/12/29 02:47:16 dankogai Exp dankogai $ # -$Revision: 1.98 $ $Date: 2003/08/20 11:15:31 $ + +$Revision: 1.99 $ $Date: 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 +! Encode.pm + prototype bug in decode_utf8() fixed + Message-Id: <600A4CDA-F004-11D7-B570-000393AE4244@dan.co.jp> +! Encode.pm /MANIFEST encoding.pm lib/Encode/Supported.pod + t/at-cn.t t/at-tw.t t/gsm0338.t ucm/gsm0338.ucm ++ t/gsm0338.t + Merged from maintperl@21987 + +1.98 2003/08/20 11:15:31 ! lib/Encode/MIME/Header.pm AUTHORS t/mime-header.t Dave Evans has found and corrected a bug in Encode::MIME::Header. Test suite added by Dan Kogai. diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index 043337b..fe1a342 100644 --- a/ext/Encode/Encode.pm +++ b/ext/Encode/Encode.pm @@ -1,9 +1,9 @@ # -# $Id: Encode.pm,v 1.98 2003/08/20 11:16:34 dankogai Exp dankogai $ +# $Id: Encode.pm,v 1.99 2003/12/29 02:47:16 dankogai Exp dankogai $ # package Encode; use strict; -our $VERSION = do { my @r = (q$Revision: 1.9801 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.99 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; sub DEBUG () { 0 } use XSLoader (); XSLoader::load(__PACKAGE__, $VERSION); @@ -195,11 +195,15 @@ sub encode_utf8($) return $str; } -sub decode_utf8($) +sub decode_utf8($;$) { - my ($str) = @_; - return undef unless utf8::decode($str); - return $str; + my ($str, $check) = @_; + if ($check){ + return decode("utf8", $str, $check); + }else{ + return undef unless utf8::decode($str); + return $str; + } } predefine_encodings(1); diff --git a/ext/Encode/META.yml b/ext/Encode/META.yml index 07327ce..f14074f 100644 --- a/ext/Encode/META.yml +++ b/ext/Encode/META.yml @@ -1,10 +1,10 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Encode -version: 1.98 +version: 1.99 version_from: Encode.pm installdirs: perl requires: distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.16 +generated_by: ExtUtils::MakeMaker version 6.21_01 diff --git a/ext/Encode/Unicode/Unicode.xs b/ext/Encode/Unicode/Unicode.xs index 70b9a5d..de15da5 100644 --- a/ext/Encode/Unicode/Unicode.xs +++ b/ext/Encode/Unicode/Unicode.xs @@ -1,5 +1,5 @@ /* - $Id: Unicode.xs,v 1.8 2003/06/18 09:29:02 dankogai Exp $ + $Id: Unicode.xs,v 1.9 2003/12/29 02:47:16 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -54,7 +54,7 @@ enc_unpack(pTHX_ U8 **sp,U8 *e,STRLEN size,U8 endian) void enc_pack(pTHX_ SV *result,STRLEN size,U8 endian,UV value) { - U8 *d = (U8 *)SvGROW(result,SvCUR(result)+size); + U8 *d = (U8 *)SvGROW(result,SvCUR(result)+size+1); switch(endian) { case 'v': case 'V': diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm index 9366252..2edf647 100644 --- a/ext/Encode/encoding.pm +++ b/ext/Encode/encoding.pm @@ -1,6 +1,6 @@ -# $Id: encoding.pm,v 1.47 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: encoding.pm,v 1.48 2003/12/29 02:47:16 dankogai Exp dankogai $ package encoding; -our $VERSION = do { my @r = (q$Revision: 1.47 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 1.48 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; use Encode; use strict; diff --git a/ext/Encode/t/enc_eucjp.t b/ext/Encode/t/enc_eucjp.t index bbe87cf..111a034 100644 --- a/ext/Encode/t/enc_eucjp.t +++ b/ext/Encode/t/enc_eucjp.t @@ -1,4 +1,4 @@ -# $Id: enc_eucjp.t,v 1.5 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: enc_eucjp.t,v 1.5 2003/08/20 11:15:31 dankogai Exp $ # This is the twin of enc_utf8.t . BEGIN { diff --git a/ext/Encode/t/enc_utf8.t b/ext/Encode/t/enc_utf8.t index 0fc1bd9..3f6fdc7 100644 --- a/ext/Encode/t/enc_utf8.t +++ b/ext/Encode/t/enc_utf8.t @@ -1,4 +1,4 @@ -# $Id: enc_utf8.t,v 1.4 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: enc_utf8.t,v 1.4 2003/08/20 11:15:31 dankogai Exp $ # This is the twin of enc_eucjp.t . BEGIN { diff --git a/ext/Encode/t/mime-header.t b/ext/Encode/t/mime-header.t index 06021b8..25438bc 100644 --- a/ext/Encode/t/mime-header.t +++ b/ext/Encode/t/mime-header.t @@ -1,5 +1,5 @@ # -# $Id: mime-header.t,v 1.8 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: mime-header.t,v 1.8 2003/08/20 11:15:31 dankogai Exp $ # This script is written in utf8 # BEGIN { diff --git a/ext/Encode/ucm/gsm0338.ucm b/ext/Encode/ucm/gsm0338.ucm index 756bdbd..a7fe1bf 100644 --- a/ext/Encode/ucm/gsm0338.ucm +++ b/ext/Encode/ucm/gsm0338.ucm @@ -1,5 +1,5 @@ # -# $Id: gsm0338.ucm,v 1.0 2002/03/28 23:26:26 dankogai Exp $ +# $Id: gsm0338.ucm,v 1.1 2003/12/29 02:47:16 dankogai Exp dankogai $ # # ./compile -n gsm0338 -o Encode/gsm0338.ucm Encode/gsm0338.enc "gsm0338" diff --git a/ext/Encode/ucm/macArabic.ucm b/ext/Encode/ucm/macArabic.ucm index f0a854c..60131c7 100644 --- a/ext/Encode/ucm/macArabic.ucm +++ b/ext/Encode/ucm/macArabic.ucm @@ -1,5 +1,5 @@ # -# $Id: macArabic.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: macArabic.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ARABIC.TXT diff --git a/ext/Encode/ucm/macFarsi.ucm b/ext/Encode/ucm/macFarsi.ucm index a2918b2..0986d9e 100644 --- a/ext/Encode/ucm/macFarsi.ucm +++ b/ext/Encode/ucm/macFarsi.ucm @@ -1,5 +1,5 @@ # -# $Id: macFarsi.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: macFarsi.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/FARSI.TXT diff --git a/ext/Encode/ucm/macHebrew.ucm b/ext/Encode/ucm/macHebrew.ucm index d32a07a..1d14cec 100644 --- a/ext/Encode/ucm/macHebrew.ucm +++ b/ext/Encode/ucm/macHebrew.ucm @@ -1,5 +1,5 @@ # -# $Id: macHebrew.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp dankogai $ +# $Id: macHebrew.ucm,v 1.21 2003/08/20 11:15:31 dankogai Exp $ # # Original table can be obtained at # http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/HEBREW.TXT