CVS: tmda/TMDA/pythonlib/email Charset.py, 1.10, 1.11 Message.py, 1.8, 1.9 __init__.py, 1.12, 1.13
"Jason R. Mastaler" <[email protected]>
| Newsgroups | gmane.mail.spam.tmda.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tmda/tmda/TMDA/pythonlib/email In directory sc8-pr-cvs1:/tmp/cvs-serv24382 Modified Files: Charset.py Message.py __init__.py Log Message: sync with email v2.5.5 Index: Charset.py =================================================================== RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/Charset.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Charset.py 26 Nov 2003 19:19:34 -0000 1.10 +++ Charset.py 2 Jan 2004 08:37:47 -0000 1.11 @@ -1,6 +1,17 @@ # Copyright (C) 2001,2002 Python Software Foundation # Author: [email protected] (Ben Gertzfield), [email protected] (Barry Warsaw) +# Python 2.3 doesn't come with any Asian codecs by default. Two packages are +# currently available and supported as of this writing (30-Dec-2003): +# +# CJKCodecs +# http://cjkpython.i18n.org +# This package contains Chinese, Japanese, and Korean codecs + +# JapaneseCodecs +# http://www.asahi-net.or.jp/~rd6t-kjym/python +# Some Japanese users prefer this codec package + from types import UnicodeType from email.Encoders import encode_7or8bit import email.base64MIME @@ -88,22 +99,11 @@ 'ascii': 'us-ascii', } -# Map charsets to their Unicode codec strings. Note that Python -# doesn't come with any Asian codecs by default. The CJKCodecs -# package available at http://cjkpython.i18n.org/ provides a unified -# unicode codec set for Chinese, Japanese and Korean encodings. +# Map charsets to their Unicode codec strings. CODEC_MAP = { - 'euc-jp': 'euc-jp', - 'iso-2022-jp': 'iso-2022-jp', - 'shift_jis': 'shift_jis', - 'euc-kr': 'euc-kr', - 'ks_c_5601-1987': 'cp949', - 'iso-2022-kr': 'iso-2022-kr', - 'johab': 'johab', - 'gb2312': 'gb2312', - 'big5': 'big5', - 'utf-8': 'utf-8', + 'gb2312': 'eucgb2312_cn', + 'big5': 'big5_tw', # Hack: We don't want *any* conversion for stuff marked us-ascii, as all # sorts of garbage might be sent to us in the guise of 7-bit us-ascii. # Let that stuff pass through without conversion to/from Unicode. @@ -215,6 +215,8 @@ # it. henc, benc, conv = CHARSETS.get(self.input_charset, (SHORTEST, BASE64, None)) + if not conv: + conv = self.input_charset # Set the attributes, allowing the arguments to override the default. self.header_encoding = henc self.body_encoding = benc @@ -224,7 +226,7 @@ self.input_codec = CODEC_MAP.get(self.input_charset, self.input_charset) self.output_codec = CODEC_MAP.get(self.output_charset, - self.input_codec) + self.output_charset) def __str__(self): return self.input_charset.lower() Index: Message.py =================================================================== RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/Message.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Message.py 5 Oct 2003 06:57:48 -0000 1.8 +++ Message.py 2 Jan 2004 08:37:47 -0000 1.9 @@ -775,7 +775,7 @@ newparams.append((pk, pv)) if not foundp: # The original Content-Type header had no boundary attribute. - # Tack one one the end. BAW: should we raise an exception + # Tack one on the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) # Replace the existing Content-Type header with the new value Index: __init__.py =================================================================== RCS file: /cvsroot/tmda/tmda/TMDA/pythonlib/email/__init__.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- __init__.py 19 Aug 2003 18:53:15 -0000 1.12 +++ __init__.py 2 Jan 2004 08:37:47 -0000 1.13 @@ -4,7 +4,7 @@ """A package for parsing, handling, and generating email messages. """ -__version__ = '2.5.4' +__version__ = '2.5.5' __all__ = [ 'base64MIME',