jkbr/httpie — pull request #75 by cido (2012-07-23 09:29:31+00:00)
Title: Encode using cp850 in Windows and using utf-8 in other environments.

I tried to google a bit about unicode support in Windows, and the results aren't too promising ones. Apparently the windows cmd.exe just doesn't have a good unicode support, and it seems that the situation won't get improved.

Some solutions suggest to use code page 65001 as an alias for UTF-8 in Windows. However, multiple sources linked to this issue thread, which says, that it is not wise to do so:
http://bugs.python.org/issue6058#msg120712

Only vialable solution that I found was this one. Basicly, because the cmd.exe native encoding is 'cp850', we just encode string in that, and replace all unknown characters with question marks.
http://stackoverflow.com/questions/11050292/prevent-encoding-errors-in-python#11050550

I know that this is not a perfect solution, but as far as I've now understood, that's pretty much the best we can have.

I've tested this solution with
Win7 + Python 3.2.2
Win8 + Python 2.7.3
Lubuntu 11.10 + 2.7.2
and it works on all of those. I used http://www.i18nguy.com/unicode-example.html as a test page. Lubuntu showed all characters as intended, and Windows showed all characters that it understood + others replaced with '?'.