I want to print a set of Unicode characters to my command prompt terminal. Even when I enforce the encoding to be "UTF-8" the terminal prints some garbage.
$python -c "import sys; print sys.stdout.write(u'\u2044'.encode('UTF-8'))"
ΓüäNone
$python -c "import sys; print sys.stdout.encoding"
cp437
My default terminal encoding is cp437 and I am trying to override that. The expected output here is Fraction slash ( ⁄ )
http://www.fileformat.info/info/unicode/char/2044/index.htm
The same piece of code works flawlessly in my Mac terminal and it uses UTF-8 as default encoding. Is there a way to display this on Windows as well? The font I use on windows command prompt is consolas.
I want my code to work with any Unicode characters, not just this particular example since the input is a web query result and I have no control over it.