Project

General

Profile

Bug #8774

rb_file_dirname return wrong encoding string when dir is "."

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

Status:
Open
Priority:
Normal
Assignee:
-
ruby -v:
ruby 2.1.0dev (2013-08-10 trunk 42491) [i386-mingw32]
[ruby-core:56544]

Description

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

rb_get_dirname.patch View (423 Bytes) 贾 延平, 08/11/2013 03:28 PM


Related issues

Related to Ruby trunk - Bug #8789: File.expand_path(File.dirname(__FILE__)) return wrong encoded result Assigned 08/16/2013

History

#1 [ruby-core:56548] Updated by Nobuyoshi Nakada almost 3 years ago

  • Status changed from Open to Feedback

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

Why do you consider it wrong?

#2 [ruby-core:56560] Updated by 贾 延平 almost 3 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.

#3 [ruby-core:56608] Updated by 贾 延平 almost 3 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?

#4 [ruby-core:56610] Updated by Nobuyoshi Nakada almost 3 years ago

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

#5 [ruby-core:56611] Updated by Nobuyoshi Nakada almost 3 years ago

  • Status changed from Feedback to Rejected

#6 [ruby-core:56612] Updated by 贾 延平 almost 3 years ago

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

#7 [ruby-core:56988] Updated by Usaku NAKAMURA almost 3 years ago

  • Status changed from Rejected to Open

(reopened. the reason is written at #8789)

#8 [ruby-core:57363] Updated by 贾 延平 almost 3 years ago

Any progress?

#9 [ruby-core:60242] 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