Project

General

Profile

Actions

Bug #8789

closed

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

Added by jiayp@glodon.com (贾 延平) over 11 years ago. Updated about 7 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-08-10 trunk 42491) [i386-mingw32]
Backport:
[ruby-core:56640]

Description

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #8774: rb_file_dirname return wrong encoding string when dir is "."ClosedActions

Updated by usa (Usaku NAKAMURA) about 11 years ago

  • Status changed from Open to Assigned

IMO, your opnion in #8774 is right.

Updated by hsbt (Hiroshi SHIBATA) almost 11 years ago

  • Target version changed from 2.1.0 to 2.2.0

Updated by usa (Usaku NAKAMURA) about 7 years ago

  • Status changed from Assigned to Open
  • Assignee deleted (windows)
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

  • Description updated (diff)
  • Status changed from Open to Closed

Fixed already.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0