Move charset parser to a utils module.
Add encoding exception catch to avoid crashes.
Use correct encoding and data type in mails.
Remove commented imports.
pep8 fix: line too long.
Add changelog file for #4000.
Merge remote-tracking branch 'ivan/bug/4000_support-non-ascii' into develop