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

Also available in: Atom PDF

Like0
Like0Like0