mercurial/mail.py
changeset 36119 6ea7f1c10c81
parent 36118 9e47bfbeb723
child 36120 54dfb65e2f82
equal deleted inserted replaced
36118:9e47bfbeb723 36119:6ea7f1c10c81
   185             raise error.Abort(_('%r specified as email transport, '
   185             raise error.Abort(_('%r specified as email transport, '
   186                                'but not in PATH') % method)
   186                                'but not in PATH') % method)
   187 
   187 
   188 def codec2iana(cs):
   188 def codec2iana(cs):
   189     ''''''
   189     ''''''
   190     cs = email.charset.Charset(cs).input_charset.lower()
   190     cs = pycompat.sysbytes(email.charset.Charset(cs).input_charset.lower())
   191 
   191 
   192     # "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"
   192     # "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"
   193     if cs.startswith("iso") and not cs.startswith("iso-"):
   193     if cs.startswith("iso") and not cs.startswith("iso-"):
   194         return "iso-" + cs[3:]
   194         return "iso-" + cs[3:]
   195     return cs
   195     return cs