From: Nobuyoshi Nakada Date: 2011-10-28T16:20:59+09:00 Subject: [ruby-core:40490] Re: [ruby-core:40487] Re: [ruby-core:40482] [ruby-trunk - Bug #5486] rb_stat() doesn’t respect input encoding Hi, (11/10/28 15:35), Nikolai Weibull wrote: > Actually, it���s probably easier than that. It can be done on a HFS+ > filesystem (and probably any other, as well) just as easily It's not true. > % echo $LC_CTYPE > UTF-8 > % mkdir t > % touch t/�� > % cat > a.rb > # -*- coding: utf-8 -*- > Dir.new('t').entries.each{ |e| printf "%p, %p, %s\n", e, e.encoding, > File.file?(e) } > ^D `e' doesn't have directory prefix, "t/". It can't stat. $ ruby -v -C t -e 'Dir.foreach(".") {|e| printf "%p, %p, %p\n", e, e.encoding, File.file?(e)}' ruby 2.0.0dev (2011-10-25 trunk 33523) [universal.x86_64-darwin11.2.0] ".", #, false "..", #, false "��", #, true -- Nobu Nakada