How to print chess symbol in windows cmd?
print '♛'
I got 'тЩЫ'.
How to print chess symbol in windows cmd?
print '♛'
I got 'тЩЫ'.
The Windows Cmd window uses Code Page 437 which doesn't contain any chess characters.
>>> print ''.join([chr(x) for x in range(256)])
☺☻♥♦
♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡
«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²
■
Python 3.3 just added the ability to use code page 65001 which is UTF-8. Use the command chcp 65001
before running Python.
You have a couple of options that I can see, an easy one and a hard one...
Use an alternative terminal than windows cmd
. I like console.
Launch the console using a Shell Link (.LNK) file, which allows you to specify a font. You might not get all of unicode, but other fonts definitely have better support for funny characters than the default. (Stolen from this answer).