Project

General

Profile

Actions

Backport #6071

closed

[Windows] exception in Dir.open doesn't respect the encoding of its argument

Added by nobu (Nobuyoshi Nakada) about 12 years ago. Updated about 12 years ago.

Status:
Closed
Assignee:
-
[ruby-dev:45279]

Description

=begin
((URL:http://toro.2ch.net/test/read.cgi/tech/1324826777/711))から引用

Windows 1.9.3 と 2.0.0dev (2012-02-19) では
(({Dir.open}))のエラー表示はUTF-8の文字列をそのままWindowsのコンソールに出力して文字化けします
Dir.open('R:/存在しないdir') #=> in `open': No such file or directory - R:/蟄伜惠縺励↑縺・ir (Errno::ENOENT)

引数を内部でUTF-8に変換してから処理しているみたいなので
どうするのがいいのかわかりません
p '日本語'.encode('UTF-8') # => "\u65E5\u672C\u8A9E"
見たいなのだと読めないしなぁ
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 12 years ago

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

This issue was solved with changeset r34794.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • dir.c (dir_initialize): keep path in original encoding.
  • error.c (syserr_initialize): prefer the encoding of message over
    locale. [ruby-dev:45279][Bug #6071]
Actions #2

Updated by naruse (Yui NARUSE) about 12 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Category deleted (M17N)
  • Target version deleted (2.0.0)
Actions

Also available in: Atom PDF

Like0
Like0Like0