diff options
| author | bwarsaw | 2002-10-17 16:41:47 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-10-17 16:41:47 +0000 |
| commit | f45119ef33ba4fbbf7807008b0ecce389a8a38db (patch) | |
| tree | 467df436a344b1d7e87133d91d2611f0f3223e39 /Mailman/Handlers/CookHeaders.py | |
| parent | b4ed353a04f9afa55d5a5d1823b9692d1881df33 (diff) | |
| download | mailman-f45119ef33ba4fbbf7807008b0ecce389a8a38db.tar.gz mailman-f45119ef33ba4fbbf7807008b0ecce389a8a38db.tar.zst mailman-f45119ef33ba4fbbf7807008b0ecce389a8a38db.zip | |
Diffstat (limited to 'Mailman/Handlers/CookHeaders.py')
| -rw-r--r-- | Mailman/Handlers/CookHeaders.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 7d181de20..a8f910770 100644 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -220,14 +220,16 @@ def prefix_subject(mlist, msg, msgdata): # If prefix is a byte string and there are funky characters in it that # don't match the charset, we might as well replace them now. if not _isunicode(prefix): - prefix = unicode(prefix, charset.get_output_charset(), 'replace') + codec = charset.input_codec or 'ascii' + prefix = unicode(prefix, codec, 'replace') # We purposefully leave no space b/w prefix and subject! h = Header(prefix, charset, header_name='Subject') for s, c in headerbits: # Once again, convert the string to unicode. if c is None: - c = 'iso-8859-1' + c = Charset('iso-8859-1') if not _isunicode(s): - s = unicode(s, c, 'replace') + codec = c.input_codec or 'ascii' + s = unicode(s, codec, 'replace') h.append(s, c) msg['Subject'] = h |
