Handle unicode attachment content in both python 2.X and python3.