##// END OF EJS Templates
mail: mime-encode patches that are utf-8...
Christian Ebert -
r7191:d1421221 default
parent child Browse files
Show More
@@ -86,6 +86,17 b' def validateconfig(ui):'
86 raise util.Abort(_('%r specified as email transport, '
86 raise util.Abort(_('%r specified as email transport, '
87 'but not in PATH') % method)
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 def _charsets(ui):
100 def _charsets(ui):
90 '''Obtains charsets to send mail parts not containing patches.'''
101 '''Obtains charsets to send mail parts not containing patches.'''
91 charsets = [cs.lower() for cs in ui.configlist('email', 'charsets')]
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