Bug #3926

Errno#message encoding is right ?

Added by Akio Tajima almost 5 years ago. Updated about 4 years ago.

[ruby-dev:42358]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-mswin32_100] Backport:

Description

=begin
Errno::*#messageは、strerrで取ってきたメッセージなので、encodingは、localeに合わせたものを設定すべきと思うのですがどうでしょうか?

irb(main):001:0> Errno::EINVAL.new.message
=> "Invalid argument"
irb(main):002:0> Errno::EINVAL.new.message.encoding
=> #Encoding:ASCII-8BIT # ……まあ良いとして
irb(main):003:0> Errno::EWOULDBLOCK.new.message
=> "\x83u\x83\x8D\x83b\x83N\x95s\x89\xC2\x82\xCC\x83\\x83P\x83b\x83g\x91\x80\x8
D\xEC\x82\xF0\x82\xB7\x82\xAE\x82\xC9\x8A\xAE\x97\xB9\x82\xC5\x82\xAB\x82\xDC\x8
2\xB9\x82\xF1\x82\xC5\x82\xB5\x82\xBD\x81B"
irb(main):004:0> Errno::EWOULDBLOCK.new.message.encoding
=> #Encoding:ASCII-8BIT # …… CP932 であって欲しい
=end

History

#1 Updated by Yui NARUSE almost 5 years ago

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

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

=end

Also available in: Atom PDF