Chris <chrisstaunton1...@gmail.com> added the comment:

found this issue while googling the error. Also having the same problem with 
as_bytes() breaking on non-ascii characters. 

I've tried policy=policy.default.clone(utf8=True) but it gives the same error. 

My sample.py file attached contains a string sample email - which has a 
character \u200d (https://unicode-table.com/en/200D/) - Zero Width Joiner in 
the body. 

UnicodeEncodeError: 'ascii' codec can't encode character '\u200d' in position 
70: ordinal not in range(128)

Any assistance on what I can do to solve it would be great. It seems I can 
parse 99% of the emails I've tried but this one has me confused.

----------
nosy: +chrisstaunton1990
Added file: https://bugs.python.org/file50641/sample.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43333>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to