Project

General

Profile

Actions

Bug #2955

closed

File.expand_path raises unexpected CompatibilityError

Added by sakuro (Sakuro OZAWA) about 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2010-03-13 trunk 26902) [x86_64-darwin10.2.0]
Backport:
[ruby-core:28635]

Description

=begin
$ ./ruby -Ilib -e "p Encoding.find('filesystem')"
#Encoding:UTF-8
./ruby -Ilib -e "p 'あ'.encoding.ascii_compatible?"
true
$ ./ruby -Ilib -e "p File.expand_path('あ', '/')"
"/あ"

The above is ok but

$ ./ruby -Ilib -e "p File.expand_path('あ', '/'.force_encoding('US-ASCII'))"
-e:1:in expand_path': incompatible character encodings: UTF-8 and US-ASCII (Encoding::CompatibilityError) from -e:1:in '

For me this is unexpected one.
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) about 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26909.
Sakuro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0