summaryrefslogtreecommitdiff
path: root/win32/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-02 07:58:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-02 07:58:24 +0000
commitf9ac2106bf0835c836bd48e82680908f5dfab233 (patch)
tree880f56b8150328745bccd90b333b183dbff13276 /win32/file.c
parent6bbd9104cbd1e1229a5c61a5e4498dc9b1a03239 (diff)
file.c: use filesystem encoding
* file.c (rb_realpath_internal): use filesystem encoding if the argument is in ASCII encodings. * win32/file.c (rb_readlink): needs the result encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/file.c')
-rw-r--r--win32/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/file.c b/win32/file.c
index e5da59646e7..5eb9eb98b7c 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -660,7 +660,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
}
VALUE
-rb_readlink(VALUE path)
+rb_readlink(VALUE path, rb_encoding *resultenc)
{
DWORD len;
VALUE wtmp = 0, wpathbuf, str;
@@ -692,7 +692,7 @@ rb_readlink(VALUE path)
ALLOCV_END(wtmp);
rb_syserr_fail_path(rb_w32_map_errno(e), path);
}
- enc = rb_filesystem_encoding();
+ enc = resultenc;
cp = path_cp = code_page(enc);
if (cp == INVALID_CODE_PAGE) cp = CP_UTF8;
str = append_wstr(rb_enc_str_new(0, 0, enc), wbuf, len, cp, path_cp, enc);