Project

General

Profile

Bug #8789

File.expand_path(File.dirname(__FILE__)) return wrong encoded result

Added by 贾 延平 about 3 years ago. Updated over 2 years ago.

Status:
Assigned
Priority:
Normal
Assignee:
cruby-windows
ruby -v:
ruby 2.1.0dev (2013-08-10 trunk 42491) [i386-mingw32]
[ruby-core:56640]

Description

=begin
A test.rb in a nonascii path with the follow content:
(({puts File.expand_path(File.dirname(FILE)).encoding}))
Run it with utf-8 as internal encoding.
expect result: UTF-8
actual result:US-ASCII

Tested on windows 7.

I submited a patch to fix this problem but in a wrong way, check it(https://bugs.ruby-lang.org/issues/8774), hope it can help to fix this problem.
=end


Related issues

Related to Ruby trunk - Bug #8774: rb_file_dirname return wrong encoding string when dir is "." Open 08/11/2013

History

#1 [ruby-core:56987] Updated by Usaku NAKAMURA about 3 years ago

  • Status changed from Open to Assigned

IMO, your opnion in #8774 is right.

#2 [ruby-core:60306] Updated by Hiroshi SHIBATA over 2 years ago

  • Target version changed from 2.1.0 to current: 2.2.0

Also available in: Atom PDF