Open ZeEmEs opened 3 years ago
@ZeEmEs thanks for your PR! Since detecting character encoding is a very complicated matter I think we need a bunch of tests here to prove the problem and the solution. Would you be willing to work on this?
@tisto - as written it depend on the text given. Most of the time the detection is correct. If you need an text example, I think I can provide one. Overall the proposed change adds the Attempt reading the encoding from the request. On failing it falls back to the prvious behavior. So I don't think many changes are needed.
Character enocding detection with chardet.detect is not 100% reliable. Use instead character encoding from request header if available.