mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
f2db4de4d8
commit
3a6152f3b3
2 changed files with 15 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue