Re: [PATCH] parser: leniently parse headers as UTF-8

2016-09-21 Thread Daniel Axtens
Hi, Stephen's suggested patch is a bit better here, so drop this for now. v2, tests, etc. to come. Regards, Daniel > If there is a non-ascii character in a header, parsing fails, > even on Py27. > > Try to decode headers as UTF-8, but if that fails, replace the > offending bytes with a character

[PATCH] parser: leniently parse headers as UTF-8

2016-09-19 Thread Daniel Axtens
If there is a non-ascii character in a header, parsing fails, even on Py27. Try to decode headers as UTF-8, but if that fails, replace the offending bytes with a character marking that decoding failed. See: https://docs.python.org/3/howto/unicode.html#python-s-unicode-support This is handy for ma