Project

General

Profile

Actions

Bug #8774

closed

rb_file_dirname return wrong encoding string when dir is "."

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

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

Description

When File.dirname()'s value is ".", the value is wrong encoded.


Files

rb_get_dirname.patch (423 Bytes) rb_get_dirname.patch jiayp@glodon.com (贾 延平), 08/11/2013 03:28 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #8789: File.expand_path(File.dirname(__FILE__)) return wrong encoded result ClosedActions

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Status changed from Open to Feedback

"." is 7bit only, it has no differences.

Why do you consider it wrong?

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

The rb_file_dirname should not return diffrent encoding string value just because the string's content diffrent.
And some other function like rb_file_expand_path will return the value with the input paramter's incoding,and the result is not 7bit string.

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

I did not write clear,the ".' having the encoding ascii-8bit not ascii-7bit,so it will be some problem.

Why ruby's default encoding is ascii-8bit not ascii-7bit,will we need the 8bit in there some condition?

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

rb_usascii_str_new2() makes a string in US-ASCII, which is 7bit.

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Status changed from Feedback to Rejected

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

Yes,you are right,maybe my problem couse by the other reason.

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Status changed from Rejected to Open

(reopened. the reason is written at #8789)

Updated by hsbt (Hiroshi SHIBATA) almost 11 years ago

  • Target version changed from 2.1.0 to 2.2.0
Actions #10

Updated by naruse (Yui NARUSE) almost 7 years ago

  • Target version deleted (2.2.0)
Actions #11

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Status changed from Open to Closed
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0