diff options
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 3226a154f..52ea90471 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -462,7 +462,13 @@ def maketext(templatefile, dict=None, raw=0, lang=None, mlist=None): text = template if dict is not None: try: - text = template % SafeDict(dict) + sdict = SafeDict(dict) + try: + text = sdict.interpolate(template) + except UnicodeError: + # Try again after coercing the template to unicode + utemplate = unicode(template, GetCharSet(lang), 'replace') + text = sdict.interpolate(utemplate) except (TypeError, ValueError): # The template is really screwed up pass |
