Skip to content

Commit 69fbca0

Browse files
committed
update checkdbs handling
1 parent f6753db commit 69fbca0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Mailman/Message.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,11 @@ def __init__(self, recip, sender, subject=None, text=None, lang=None):
251251
charset = None
252252
if lang is not None:
253253
charset = Charset(GetCharSet(lang))
254+
# Ensure we have a valid output charset
255+
if charset.output_charset == 'us-ascii':
256+
charset = Charset('utf-8')
254257
else:
255-
charset = Charset('us-ascii') # Use us-ascii as fallback when lang is None
258+
charset = Charset('utf-8') # Use utf-8 as fallback when lang is None
256259
if text is not None:
257260
self.set_payload(text, charset)
258261
if subject is None:

0 commit comments

Comments
 (0)