'Python/WSGI: Determining HTTP request charset

Is there any way to reliably determine in which character set browser sends data? I'm jumping around Accept-Charset/Accept-Language headers in conjunction with server locale (as most web-sites are not that world-wide), but still, nothing comes to mind.

Specifically, MSIE sends data in locale's charset if the user types in address bar custom values (that's why I started to count in Accept-Language header).

The second question is, can I determine charset for both GET and POST or there is a chance that data would be in different encodings?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source