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

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Oct 20 16:53:33 UTC 2009


Author: jawnsy-guest
Date: Tue Oct 20 16:53:17 2009
New Revision: 46114

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

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

Modified: branches/upstream/libmime-charset-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmime-charset-perl/current/Changes?rev=46114&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Changes (original)
+++ branches/upstream/libmime-charset-perl/current/Changes Tue Oct 20 16:53:17 2009
@@ -1,3 +1,15 @@
+2009-10-19	Hatuka*nezumi - IKEDA Soji	<hatuka(at)nezumi.nu>
+
+	* Release 1.008.
+	* Imp: support for iso-8859-6-[ei], iso-8859-8-[ei].  cf. report by
+	  Hanne Moa on Sympa bug #6385 at <http://sourcesup.cru.fr/>.
+	* Imp: support for iso-8859-16.
+	* Imp: Allow body transfer-encoding profile "S".
+	* Chg: Default body transfer-encoding for UTF-8 from "B" to "S".
+	* Doc: Some fixes. New section "Incompatible changes".
+	* Fix: META.yml: optional_features is not hashref but arrayref.
+	  Thanks SREZIC at CPAN.
+
 2009-06-16	Hatuka*nezumi - IKEDA Soji	<hatuka(at)nezumi.nu>
 
 	* Release 1.007.1.

Modified: branches/upstream/libmime-charset-perl/current/Charset.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmime-charset-perl/current/Charset.pm?rev=46114&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Charset.pm (original)
+++ branches/upstream/libmime-charset-perl/current/Charset.pm Tue Oct 20 16:53:17 2009
@@ -123,14 +123,14 @@
     }
 }
 
-$VERSION = '1.007.1';
+$VERSION = '1.008';
 
 ######## Private Attributes ########
 
 my $DEFAULT_CHARSET = 'US-ASCII';
 my $FALLBACK_CHARSET = 'UTF-8';
 
-# This table was borrwed from Python email package.
+# This table was initially borrowed from Python email package.
 
 my %CHARSETS = (# input		    header enc body enc output conv
 		'ISO-8859-1' =>		['Q',	'Q',	undef],
@@ -147,6 +147,7 @@
 		'ISO-8859-13' =>	['Q',	'Q',	undef],
 		'ISO-8859-14' =>	['Q',	'Q',	undef],
 		'ISO-8859-15' =>	['Q',	'Q',	undef],
+		'ISO-8859-16' =>	['Q',	'Q',	undef],
 		'WINDOWS-1252' =>	['Q',	'Q',	undef],
 		'VISCII' =>		['Q',	'Q',	undef],
 		'US-ASCII' =>		[undef,	undef,	undef],
@@ -195,8 +196,10 @@
 				     ['cp1256'],        # Encode::Byte
 				     # ['cp1006'],      # ditto, for Farsi
 				    ],
+		    'ISO-8859-6-I'=>[['cp1256'], ],     # ditto
 		    'ISO-8859-7' => [['cp1253'], ],     # Encode::Byte
 		    'ISO-8859-8' => [['cp1255'], ],     # Encode::Byte
+		    'ISO-8859-8-I'=>[['cp1255'], ],     # ditto
 		    'ISO-8859-9' => [['cp1254'], ],     # Encode::Byte
 		    'ISO-8859-13'=> [['cp1257'], ],     # Encode::Byte
 		    'GB2312'     => [['cp936'], ],      # Encode::CN
@@ -226,6 +229,10 @@
 		    'UTF-8'      => [['utf8'], ],       # Special name on Perl
 		},
 		'STANDARD' => {
+		    'ISO-8859-6-E'  => [['iso-8859-6'],],# Encode::Byte
+		    'ISO-8859-6-I'  => [['iso-8859-6'],],# ditto
+		    'ISO-8859-8-E'  => [['iso-8859-8'],],# Encode::Byte
+		    'ISO-8859-8-I'  => [['iso-8859-8'],],# ditto
 		    'GB18030'       => [['gb18030',     'Encode::HanExtra'], ],
 		    'EUC-JISX0213'  => [['euc-jisx0213', 'Encode::JIS2K'], ],
 		    'ISO-2022-JP-3' => [['iso-2022-jp-3', 'Encode::JIS2K'], ],
@@ -405,7 +412,8 @@
 
 Get recommended transfer-encoding of CHARSET for message body.
 
-Returned value will be one of C<"B"> (BASE64), C<"Q"> (QUOTED-PRINTABLE) or
+Returned value will be one of C<"B"> (BASE64), C<"Q"> (QUOTED-PRINTABLE),
+C<"S"> (shorter one of either) or
 C<undef> (might not be transfer-encoded; either 7BIT or 8BIT).  This may
 not be same as encoding for message header.
 
@@ -441,6 +449,8 @@
 =item $charset->decoder
 
 Get L<"Encode::Encoding"> object to decode strings to Unicode by charset.
+If charset is not specified or not known by this module,
+undef will be returned.
 
 =cut
 
@@ -595,6 +605,12 @@
             $enc = '7BIT';
             $cset = 'US-ASCII';
         }
+    } elsif ($enc eq 'S') {
+	if (_enclen_B($encoded) < _enclen_Q($encoded, 1)) {
+	    $enc = 'B';
+	} else {
+	    $enc = 'Q';
+	}
     } elsif ($enc eq 'B') {
         $enc = 'BASE64';
     } elsif ($enc eq 'Q') {
@@ -729,9 +745,15 @@
     int((length(shift) + 2) / 3) * 4;
 }
 
-sub _enclen_Q($) {
+sub _enclen_Q($;$) {
     my $s = shift;
-    my @o = ($s =~ m{([^- !*+/0-9A-Za-z])}gos);
+    my $in_body = shift;
+    my @o;
+    if ($in_body) {
+	@o = ($s =~ m{([^-\t\r\n !*+/0-9A-Za-z])}go);
+    } else {
+	@o = ($s =~ m{([^- !*+/0-9A-Za-z])}gos);
+    }
     length($s) + scalar(@o) * 2;
 }
 
@@ -1026,7 +1048,8 @@
 C<undef> (might not be encoded).
 
 BODYENC is recommended transfer-encoding for message body.  It may be
-one of C<"B">, C<"Q"> or C<undef> (might not be transfer-encoded).
+one of C<"B">, C<"Q">, C<"S"> (shorter one of either) or
+C<undef> (might not be transfer-encoded).
 
 ENCCHARSET is a charset which is compatible with given CHARSET and
 is recommended to be used for MIME messages on Internet.
@@ -1135,6 +1158,49 @@
 Development versions of this module may be found at
 L<http://hatuka.nezumi.nu/repos/MIME-Charset/>.
 
+=head2 Incompatible Changes
+
+=over 4
+
+=item Release 1.001
+
+=over 4
+
+=item o
+
+new() method returns an object when CHARSET argument is not specified.
+
+=back
+
+=item Release 1.005
+
+=over 4
+
+=item o
+
+Restrict characters in encoded-word according to RFC 2047 section 5 (3).
+This also affects return value of encoded_header_len() method.
+
+=back
+
+=item Release 1.008
+
+=over 4
+
+=item o
+
+body_encoding() method may also returns C<"S">.
+
+=item o
+
+Return value of body_encode() method for UTF-8 may include
+C<"QUOTED-PRINTABLE"> encoding item that in earlier versions was fixed to
+C<"BASE64">.
+
+=back
+
+=back
+
 =head1 SEE ALSO
 
 Multipurpose Internet Mail Extensions (MIME).

Modified: branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod?rev=46114&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod (original)
+++ branches/upstream/libmime-charset-perl/current/Charset/JA_JP.pod Tue Oct 20 16:53:17 2009
@@ -129,7 +129,7 @@
 
 CHARSET のメッセージ本体で推奨される伝送エンコーディングを取得する。
 
-返値は C<"B"> (BASE64)、C<"Q"> (QUOTED-PRINTABLE)、
+返値は C<"B"> (BASE64)、C<"Q"> (QUOTED-PRINTABLE)、C<"S"> (どちらか短いほう)、
 C<undef> (伝送エンコードしなくてよい --- 7BIT か 8BIT)
 のいずれか。これはメッセージヘッダのエンコーディングとは違うこともある。
 
@@ -147,6 +147,7 @@
 
 キャラクタセットを Unicode に復号するのに使う
 L<"Encode::Encoding"> オブジェクトを返す。
+キャラクタセットが指定されていなかったか、当モジュールの知らないキャラクタセットであった場合は、undef 値を返す。
 
 =cut
 
@@ -409,7 +410,7 @@
 C<undef> (エンコードしなくてよい) を指定できる。
 
 BODYENC はメッセージ本体で推奨される伝送エンコーディング。
-C<"B">、C<"Q">、C<undef> (伝送エンコードしなくてよい) を指定できる。
+C<"B">、C<"Q">、C<"S"> (どちらか短くなるほう)、C<undef> (伝送エンコードしなくてよい) を指定できる。
 
 ENCCHARSET は、指定した CHARSET と互換で、インターネット上の
 MIME メッセージで使うことを推奨されるキャラクタセット名。
@@ -497,6 +498,48 @@
 このモジュールの開発版が
 L<http://hatuka.nezumi.nu/repos/MIME-Charset/> にある。
 
+=head2 非互換な変更
+
+=over 4
+
+=item リリース 1.001
+
+=over 4
+
+=item o
+
+new() メソッドは CHARSET 引数を指定しなくてもオブジェクトを返すようになった。
+
+=back
+
+=item リリース 1.005
+
+=over 4
+
+=item o
+
+encoded-word に含まれる文字種を RFC 2047 の 5 (3) 節のとおりにした。
+encoded_header_len() メソッドの返値も変わる。
+
+=back
+
+=item リリース 1.008
+
+=over 4
+
+=item o
+
+body_encoding() メソッドも C<"S"> を返せるようになった。
+
+=item o
+
+body_encode() メソッドの UTF-8 に対する返値のエンコーディング要素は、
+これまでのリリースでは C<"BASE64"> に固定だったが、C<"QUOTED-PRINTABLE"> になることがある。
+
+=back
+
+=back
+
 =head1 SEE ALSO
 
 Multipurpose Internet Mail Extensions (MIME).

Modified: branches/upstream/libmime-charset-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmime-charset-perl/current/META.yml?rev=46114&op=diff
==============================================================================
--- branches/upstream/libmime-charset-perl/current/META.yml (original)
+++ branches/upstream/libmime-charset-perl/current/META.yml Tue Oct 20 16:53:17 2009
@@ -1,7 +1,7 @@
 --- #YAML:1.0
 name:         MIME-Charset
 abstract:     Charset Informations for MIME
-version:      1.007.1
+version:      1.008
 author:
   - Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu>
 license:      perl
@@ -10,15 +10,15 @@
     Encode:                        1.98
     perl:                          5.005
 optional_features:
-- ja_extended:
+  ja_extended:
     description: Extended mappings by Japanese codepages
     requires:
         Encode::EUCJPASCII:        0.02
-- jis2000:
+  jis2000:
     description: Additional mappings for JIS X 0213:2000
     requires:
         Encode::JIS2K:             0.02
-- zh_extra:
+  zh_extra:
     description: Additional mappings for Chinese standards
     requires:
         Encode::HanExtra:          0.20
@@ -27,7 +27,7 @@
 provides:
     MIME::Charset:
         file:                      Charset.pm
-        version:                   1.007.1
+        version:                   1.008
 resources:
     repository: http://hatuka.nezumi.nu/repos/MIME-Charset/
 meta-spec:




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