Project

General

Profile

Actions

Bug #9930

closed

unicode filenames somehow don't work

Added by rogerdpack (Roger Pack) over 10 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
Target version:
-
ruby -v:
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
[ruby-core:63092]

Description

Something seems amiss here--I can't seem to pass in a unicode filename and have it used for reading/opening a file:

C:\>type read.rb
p ARGV
p Dir['*']
p File.binread(ARGV[0]).size

c:\>ruby read.rb "( ͡° ͜ʖ ͡°).mp4"
["( ?\xB0 ?? ?\xB0).mp4"]
["( ?\xB0 ?? ?\xB0).mp4"]
read.rb:3:in `binread': Invalid argument - ( ?° (Errno::EINVAL)
        from read.rb:3:in `<main>'

(jruby too, fwiw...)

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Description updated (diff)
  • Category set to platform/windows
  • Assignee set to windows
  • Target version set to 2.2.0

ARGV is still in the default external encoding, i.e., console codepage.

We'd like to make them UTF-8, but have no concrete migration plan yet.

Actions #2

Updated by naruse (Yui NARUSE) almost 7 years ago

  • Target version deleted (2.2.0)

Updated by jeremyevans0 (Jeremy Evans) over 3 years ago

  • Status changed from Open to Closed

As of Ruby 3.0, ARGV values are in UTF-8 encoding by default on Windows.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0