Show More
@@ -86,6 +86,17 b' def validateconfig(ui):' | |||
|
86 | 86 | raise util.Abort(_('%r specified as email transport, ' |
|
87 | 87 | 'but not in PATH') % method) |
|
88 | 88 | |
|
89 | def mimetextpatch(s, subtype='plain', display=False): | |
|
90 | '''If patch in utf-8 transfer-encode it.''' | |
|
91 | if not display: | |
|
92 | for cs in ('us-ascii', 'utf-8'): | |
|
93 | try: | |
|
94 | s.decode(cs) | |
|
95 | return email.MIMEText.MIMEText(s, subtype, cs) | |
|
96 | except UnicodeDecodeError: | |
|
97 | pass | |
|
98 | return email.MIMEText.MIMEText(s, subtype) | |
|
99 | ||
|
89 | 100 | def _charsets(ui): |
|
90 | 101 | '''Obtains charsets to send mail parts not containing patches.''' |
|
91 | 102 | charsets = [cs.lower() for cs in ui.configlist('email', 'charsets')] |
General Comments 0
You need to be logged in to leave comments.
Login now