Dir.home encoding is incorrect on Windows
Dir.home string itself is actually returned encoded in cp775 (no matter what consoles encoding is)
but encoding information is as windows default encoding.
For example, if my home directory is C:\Users\Dāvis and windows default encoding 1257 with cosnole's encoding as 1252
dir = Dir.home
As can see, x83 is ā character in 775 encoding.