Project

General

Profile

Actions

Bug #8774

closed

rb_file_dirname return wrong encoding string when dir is "."

Bug #8774: rb_file_dirname return wrong encoding string when dir is "."

Added by jiayp@glodon.com (贾 延平) about 12 years ago. Updated over 6 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 - Bug #8789: File.expand_path(File.dirname(__FILE__)) return wrong encoded result ClosedActions

Updated by nobu (Nobuyoshi Nakada) about 12 years ago Actions #1 [ruby-core:56548]

  • Status changed from Open to Feedback

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

Why do you consider it wrong?

Updated by jiayp@glodon.com (贾 延平) about 12 years ago Actions #2 [ruby-core:56560]

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 (贾 延平) about 12 years ago Actions #3 [ruby-core:56608]

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) about 12 years ago Actions #4 [ruby-core:56610]

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

Updated by nobu (Nobuyoshi Nakada) about 12 years ago Actions #5 [ruby-core:56611]

  • Status changed from Feedback to Rejected

Updated by jiayp@glodon.com (贾 延平) about 12 years ago Actions #6 [ruby-core:56612]

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

Updated by usa (Usaku NAKAMURA) about 12 years ago Actions #7 [ruby-core:56988]

  • Status changed from Rejected to Open

(reopened. the reason is written at #8789)

Updated by hsbt (Hiroshi SHIBATA) over 11 years ago Actions #9 [ruby-core:60242]

  • Target version changed from 2.1.0 to 2.2.0

Updated by naruse (Yui NARUSE) almost 8 years ago Actions #10

  • Target version deleted (2.2.0)

Updated by jeremyevans0 (Jeremy Evans) over 6 years ago Actions #11

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

Also available in: PDF Atom