Encode string representation of Environment object for seamless printing
Encode directory names to filesystem encoding for proper comparison

Dir.entries have filesystem encoding (ANSI in Windows).
Path fragments have terminal encoding (DOS).
Merge pull request #4159 from vassilevsky/windows-encodings

core: windows encoding fixes