I've tried to display UTF-8 in the win7 cmd. Currently, I'm using the standard font because as I see with the mysql.exe, it works fine with the characters I'm working with (currently the german umlauts "ßäöüÄÖÜ"). Also, with another font, the same characters appear.
But the output of my PHP script displays garbage, e.g. 'ß' for 'ß'. When I pipe the output into a file and open it up with Notepad++, it says the encoding is UTF-8. In php.ini I set UTF-8 as the encoding as well as in the connection to the mySQL database, and in the database itself UTF-8, too.
In CMD I tried so far to set the code page to 65001, but nothing changes.
edit: my PHP script is saved as UTF-8 as well
It seems with latin1, my desired characters can be displayed too and actually it works. But there has to be a way to do it in UTF-8? I can't convert everything to latin1
CMD.exe is a just one of programs which are ready to “work inside” a console (“console applications”). AFAIK, CMD has perfect support for Unicode; you can enter/output all Unicode chars when any codepage is active.
The encoding of cmd does not support non-ASCII character. (Or the deeper layer does not support non-ASCII).
To start it from the taskbar or anywhere else, make a shortcut (you can name it cmd. unicode.exe or whatever you like) and change its Target to C:\Windows\System32\cmd.exe /K chcp 65001 .
This question has been already answered in Unicode characters in Windows command line - how?
You missed one step -> you need to use Lucida console fonts in addition to executing chcp 65001 from cmd console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With