I've found a rather weird issue while investigating the twisted world of character encoding. In Windows, if I type 'tree' the command works as expected but if I then type 'chcp 65001' (which is UTF-8) and then 'tree' again it breaks.
i.e.
> tree
> chcp 65001
> tree
This is in Windows 7, vanilla cmd, spanish language. Also, when redirecting output to a file the contents of it are the same before and after the chcp (full of "ÀÄÄÄa").
Some research showed that the encoding is OEM-850.
I know this looks like a superfluous question but when compiling programs (with gcc mostly) I have the same problem.
Switches /A and /U for cmd didn't help either.