[Python-checkins] python/dist/src/Lib/email Charset.py,1.7,1.8
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Thu, 10 Oct 2002 08:11:23 -0700
Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv22654
Modified Files:
Charset.py
Log Message:
__init__(): RFC 2046 $4.1.2 says charsets are not case sensitive.
Coerce the argument to lower case. Also, since body encodings can't
be SHORTEST, default the CHARSETS failobj's second item to BASE64.
Index: Charset.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Charset.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Charset.py 1 Oct 2002 00:02:33 -0000 1.7
--- Charset.py 10 Oct 2002 15:11:20 -0000 1.8
***************
*** 178,181 ****
--- 178,183 ----
"""
def __init__(self, input_charset=DEFAULT_CHARSET):
+ # RFC 2046, $4.1.2 says charsets are not case sensitive
+ input_charset = input_charset.lower()
# Set the input charset after filtering through the aliases
self.input_charset = ALIASES.get(input_charset, input_charset)
***************
*** 184,188 ****
# it.
henc, benc, conv = CHARSETS.get(self.input_charset,
! (SHORTEST, SHORTEST, None))
# Set the attributes, allowing the arguments to override the default.
self.header_encoding = henc
--- 186,190 ----
# it.
henc, benc, conv = CHARSETS.get(self.input_charset,
! (SHORTEST, BASE64, None))
# Set the attributes, allowing the arguments to override the default.
self.header_encoding = henc