Index: dir.c =================================================================== --- dir.c (revision 42491) +++ dir.c (working copy) @@ -891,6 +891,7 @@ path = my_getcwd(); cwd = rb_tainted_str_new2(path); rb_enc_associate(cwd, rb_filesystem_encoding()); + cwd = rb_str_encode_ospath(cwd); xfree(path); return cwd;