mail: fix _encode to be more correct on Python 3...
mail: fix _encode to be more correct on Python 3
This code appears to be on the wrong side of the law in Python 2, at
least some of the time. In Python 3, it's definitely wrong in places,
but fortunately that's easy to fix.
Differential Revision:
https://phab.mercurial-scm.org/D3953