Fix for incorrect default encoding on Windows.
Merge pull request #4163 from dhirschfeld/encoding-fix

Fix for incorrect default encoding on Windows.