r18842 - in /branches/upstream/libmime-charset-perl/current: Changes Charset.pm Charset/JA_JP.pod META.yml README

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sat Apr 19 19:23:38 UTC 2008


Author: gregoa
Date: Sat Apr 19 19:23:37 2008
New Revision: 18842

URL: http://svn.debian.org/wsvn/?sc=1&rev=18842
Log:
[svn-upgrade] Integrating new upstream version, libmime-charset-perl (1.006.2)

Modified:
    branches/upstream/libmime-charset-perl/current/Changes
    branches/upstream/libmime-charset-perl/current/Charset.pm
    branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod
    branches/upstream/libmime-charset-perl/current/META.yml
    branches/upstream/libmime-charset-perl/current/README

Modified: branches/upstream/libmime-charset-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libmime-charset-perl/current/Changes?rev=18842&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Changes (original)
+++ branches/upstream/libmime-charset-perl/current/Changes Sat Apr 19 19:23:37 2008
@@ -1,14 +1,23 @@
-2008-XX-XX	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
-	* Release 1.0XX.
-	* Bug Fix: CPAN RT #34909: Test failures (fixed at 1.006.1).
+2008-04-17	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
+
+	* Release 1.006.2 - bug fixes only; no new features.
+	* Bug Fix: Perl >= 5.8.1: CPAN RT #34909: Test failures.
+	* Bug Fix: Perl >= 5.10.0: CPAN RT #35070: HZ words are
+	  encoded as US-ASCII; added workaround for CPAN RT #35120.
+	* Fix: Perl 5.11.0: Suppress ``Use of uninitialized value
+	  within @_ in uc'' warnings.
+	* JA_JP.pod: Clarify distinction between ``符号化'' (on
+	  charset) and ``エンコード'' (on encoding).
 
 2008-04-12	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
+
 	* Release 1.006.
 	* Workarounds for ``US-ASCII transformation'' charsets
 	  i.e. HZ-GB-2312 (RFC1842) and UTF-7 (RFC 2152).
 	* Added tests.
 
 2008-04-07	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
+
 	* Release 1.005.
 	* _enclen_Q(): Restrict characters in encoded-word
 	  according to RFC 2047 section 5 (3).
@@ -17,6 +26,7 @@
 	  US-ASCII: Works on pre-Encode environments.
 
 2008-03-30	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
+
 	* Release 1.004.
 	* Added ESTI GSM 03.38 which won't be used for MIME
 	  messages (experimental).
@@ -27,6 +37,7 @@
 	* Bug Fix: Perl <=5.005: our is ``withdrawn''.
 
 2008-03-20	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
+
 	* Release 1.002.
 	* New method undecode().
 	* encoder(): added argument to set instance.

Modified: branches/upstream/libmime-charset-perl/current/Charset.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libmime-charset-perl/current/Charset.pm?rev=18842&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Charset.pm (original)
+++ branches/upstream/libmime-charset-perl/current/Charset.pm Sat Apr 19 19:23:37 2008
@@ -121,7 +121,7 @@
     }
 }
 
-$VERSION = '1.006.1';
+$VERSION = '1.006.2';
 
 ######## Private Attributes ########
 
@@ -359,7 +359,7 @@
 }
 
 sub _find_encoder($$) {
-    my $charset = uc(shift);
+    my $charset = uc(shift || "");
     return undef unless $charset;
     my $mapping = uc(shift);
     my ($spec, $name, $module, $encoder);
@@ -427,7 +427,7 @@
 
 =item $charset->decoder
 
-Get L<"Encode::Encoding"> object to decode strings by charset.
+Get L<"Encode::Encoding"> object to decode strings to Unicode by charset.
 
 =cut
 
@@ -609,7 +609,7 @@
 
 Encode STRING (Unicode or non-Unicode) using compatible charset recommended
 to be used for messages on Internet (if this module knows it).
-Note that string will be decoded then encoded even if compatible charset
+Note that string will be decoded to Unicode then encoded even if compatible charset
 was equal to original charset.
 
 B<Note>:
@@ -626,7 +626,9 @@
     unless (is_utf8($s) or $s =~ /[^\x00-\xFF]/) {
 	$s = $self->{Decoder}->decode($s, ($check & 0x1)? FB_CROAK(): 0);
     }
-    $self->{Encoder}->encode($s, $check);
+    my $enc = $self->{Encoder}->encode($s, $check);
+    Encode::_utf8_off($enc); # workaround for RT #35120
+    $enc;
 }
 
 =item $charset->encoded_header_len(STRING [, ENCODING])
@@ -646,7 +648,7 @@
     my ($encoding, $s);
     if (ref $self) {
 	$s = shift;
-	$encoding = uc(shift) || $self->{HeaderEncoding};
+	$encoding = uc(shift || $self->{HeaderEncoding});
     } else {
 	$s = $self;
 	$encoding = uc(shift);
@@ -807,11 +809,13 @@
 						Mapping => 'STANDARD');
 		    # croak unknown charset
 		    croak "unknown charset ``$FALLBACK_CHARSET''"
-			unless $charset->{Decoder};
-		    # charset transformation
+			unless $cset->{Decoder};
+		    # charset translation
+		    $charset = $charset->dup;
 		    $charset->encoder($cset);
 		    $encoded = $s;
 		    $encoded = $charset->encode($encoded, 0);
+		    # replace input & output charsets with fallback charset
 		    $cset->encoder($cset);
 		    $charset = $cset;
 		} else {
@@ -829,22 +833,20 @@
 
     if ($encoded !~ /$NONASCIIRE/) { # maybe ASCII
 	# check ``ASCII transformation'' charsets
-	if ($charset->{OutputCharset} =~ /^($ASCIITRANSRE)$/ and
-	    $encoded =~ /[+~]/) {
+	if ($charset->{OutputCharset} =~ /^($ASCIITRANSRE)$/) {
 	    my $u = $encoded;
-	    if ($charset->encoder) {
+	    if (USE_ENCODE) {
 		$u = $charset->encoder->decode($encoded); # dec. by output
-	    } elsif (!USE_ENCODE) { # workaround for pre-Encode environment
+	    } elsif ($encoded =~ /[+~]/) { # workaround for pre-Encode env.
 		$u = "x$u";
-	    } else { # NOTREACHED
-		croak __PACKAGE__.": bug in _text_encode.  Report developer.";
 	    }
-	    $charset->encoder(__PACKAGE__->new($DEFAULT_CHARSET,
-					       Mapping => 'STANDARD'))
-		if $u eq $encoded;
+	    if ($u eq $encoded) {
+		$charset = $charset->dup;
+		$charset->encoder($DEFAULT_CHARSET);
+	    }
 	} elsif ($charset->{OutputCharset} ne "US-ASCII") {
-	    $charset->encoder(__PACKAGE__->new($DEFAULT_CHARSET,
-					       Mapping => 'STANDARD'));
+	    $charset = $charset->dup;
+	    $charset->encoder($DEFAULT_CHARSET);
 	}
     }
 
@@ -861,7 +863,7 @@
 	my ($seq, $cset) = @$_;
 	if (index($s, $seq) >= 0) {
             my $decoder = __PACKAGE__->new($cset);
-            next unless $decoder and $decoder->{Decoder};
+            next unless $decoder->{Decoder};
             eval {
 		my $dummy = $s;
 		$decoder->decode($dummy, FB_CROAK());
@@ -893,7 +895,9 @@
     my $self = shift;
     my $s = shift;
     my $check = shift || 0;
-    $self->{Decoder}->encode($s, $check);
+    my $enc = $self->{Decoder}->encode($s, $check);
+    Encode::_utf8_off($enc); # workaround for RT #35120
+    $enc;
 }
 
 =head2 Manipulating Module Defaults

Modified: branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod
URL: http://svn.debian.org/wsvn/branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod?rev=18842&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod (original)
+++ branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod Sat Apr 19 19:23:37 2008
@@ -79,7 +79,7 @@
 B<キャラクタセット> とは、MIME での ``character set'' のことで、
 オクテットの列を文字の列に変換する方法を指す。
 これは、ISO/IEC における ``符号化文字集合'' (CCS) と
-``文字符合化法'' (CES) の両方の概念をåŒ
含する。
+``文字符号化法'' (CES) の両方の概念をåŒ
含する。
 
 B<エンコーディング> とは、MIME でのそれのことで、
 メッセージ本体やメッセージヘッダ本体を印字可能な
@@ -138,7 +138,7 @@
 
 =item $charset->decoder
 
-キャラクタセットをデコードするのに使う
+キャラクタセットを Unicode に復号するのに使う
 L<"Encode::Encoding"> オブジェクトを返す。
 
 =cut
@@ -152,10 +152,10 @@
 =item $charset->encoder([CHARSET])
 
 インターネット上の MIME
-メッセージで使うことを推奨される互換キャラクタセットでエンコードするのに使う
+メッセージで使うことを推奨される互換キャラクタセットで符号化するのに使う
 L<"Encode::Encoding"> オブジェクトを返す。
 
-CHARSET 引数を指定した場合、$charset オブジェクトのエンコーダ
+CHARSET 引数を指定した場合、$charset オブジェクトの符号化器
 (および出力キャラクタセット名) を、CHARSET のそれに置き換える。
 つまり、$charset オブジェクトはå
ƒã®ã‚­ãƒ£ãƒ©ã‚¯ã‚¿ã‚»ãƒƒãƒˆã‹ã‚‰æ–°ãŸãª
 CHARSET への変換器となる。
@@ -232,7 +232,7 @@
 
 =item $charset->decode(STRING [,CHECK])
 
-STRING を Unicode 文字列にデコードする。
+STRING を Unicode 文字列に復号する。
 
 B<NOTE>:
 Unicode/マルチバイト対応が有効になっていないとき (L<"USE_ENCODE"> 参ç
§) は、
@@ -245,9 +245,9 @@
 STRING (Unicode 文字列または普通の文字列) を、
 å
ƒã®ã‚­ãƒ£ãƒ©ã‚¯ã‚¿ã‚»ãƒƒãƒˆã¨äº’換でインターネット上の
 MIME メッセージで使うことを推奨されるキャラクタセットを
-(当モジュールが知っていれば) 使って、エンコードする。
+(当モジュールが知っていれば) 使って、符号化する。
 å
ƒã®ã‚­ãƒ£ãƒ©ã‚¯ã‚¿ã‚»ãƒƒãƒˆã¨äº’換キャラクタセットが同じでも、
-文字列をデコードしてからエンコードすることに注意。
+文字列を Unicode に復号してから符号化することに注意。
 
 B<NOTE>:
 Unicode/マルチバイト対応が有効になっていないとき (L<"USE_ENCODE"> 参ç
§) は、
@@ -300,7 +300,7 @@
 のいずれか。
 I<出力のキャラクタセット> が決定できず、I<変換ずみの文字列>
 が ASCII以外のバイトを含むときは、I<出力のキャラクタセット> は C<"8BIT">
-(これはキャラクタセットの名前ではI<なく>、エンコード不可能なデータを表す特殊値)
+(これはキャラクタセットの名前ではI<なく>、符号化が不可能なデータを表す特殊値)
 で I<エンコーディング法> は C<undef> (エンコードするべきではない) となる。
 I<出力のキャラクタセット> が C<"US-ASCII">
 となるのは、文字列が ASCII以外のバイトを含まないときに限る。
@@ -424,7 +424,7 @@
 =item C<"DEFAULT">
 
 不正な文字を置き換え文字で置き換える。
-UCM に基づくエンコーダを持つキャラクタセットでは <subchar> を使うことがある。
+UCM に基づく符号化器を持つキャラクタセットでは <subchar> を使うことがある。
 
 =item C<"FALLBACK">
 

Modified: branches/upstream/libmime-charset-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libmime-charset-perl/current/META.yml?rev=18842&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/META.yml (original)
+++ branches/upstream/libmime-charset-perl/current/META.yml Sat Apr 19 19:23:37 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         MIME-Charset
-version:      1.006.1
+version:      1.006.2
 version_from: Charset.pm
 installdirs:  site
 requires:

Modified: branches/upstream/libmime-charset-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libmime-charset-perl/current/README?rev=18842&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/README (original)
+++ branches/upstream/libmime-charset-perl/current/README Sat Apr 19 19:23:37 2008
@@ -107,7 +107,8 @@
         Get canonical name for charset.
 
     $charset->decoder
-        Get "Encode::Encoding" object to decode strings by charset.
+        Get "Encode::Encoding" object to decode strings to Unicode by
+        charset.
 
     $charset->dup
         Get a copy of charset object.
@@ -174,8 +175,8 @@
     $charset->encode(STRING [,CHECK])
         Encode STRING (Unicode or non-Unicode) using compatible charset
         recommended to be used for messages on Internet (if this module
-        knows it). Note that string will be decoded then encoded even if
-        compatible charset was equal to original charset.
+        knows it). Note that string will be decoded to Unicode then encoded
+        even if compatible charset was equal to original charset.
 
         Note: When Unicode/multibyte support is disabled (see "USE_ENCODE"),
         this function will die.




More information about the Pkg-perl-cvs-commits mailing list