summaryrefslogtreecommitdiffstats
path: root/Lib/email/charset.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-03-15 01:13:03 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-03-15 01:13:03 (GMT)
commit3a6152f3b3346f00371faad8fc8a9cfb3085682f (patch)
treee876113081ac14159447af678d9568aaf8458c07 /Lib/email/charset.py
parentf2db4de4d82101a900ff3b000e39ee9207ff8bf7 (diff)
downloadcpython-3a6152f3b3346f00371faad8fc8a9cfb3085682f.zip
cpython-3a6152f3b3346f00371faad8fc8a9cfb3085682f.tar.gz
cpython-3a6152f3b3346f00371faad8fc8a9cfb3085682f.tar.bz2
Fix header encoding of long headers when using euc-jp and shift_jis.
When a header was long enough to need to be split across lines, the input charset name was used instead of the output charset name in the encoded words. This make a difference only for the two charsets above.
Diffstat (limited to 'Lib/email/charset.py')
-rw-r--r--Lib/email/charset.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/charset.py b/Lib/email/charset.py
index 8591527..24d5545 100644
--- a/Lib/email/charset.py
+++ b/Lib/email/charset.py
@@ -321,7 +321,7 @@ class Charset:
codec = self.output_codec or 'us-ascii'
header_bytes = _encode(string, codec)
encoder_module = self._get_encoder(header_bytes)
- encoder = partial(encoder_module.header_encode, charset=str(self))
+ encoder = partial(encoder_module.header_encode, charset=codec)
# Calculate the number of characters that the RFC 2047 chrome will
# contribute to each line.
charset = self.get_output_charset()