* error.c (syserr_initialize): set the encoding of Errno::*#message
as locale. [ruby-dev:42358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
47cb5a93e5
commit
44691b901e
@ -1,3 +1,8 @@
|
|||||||
|
Mon Oct 11 14:03:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* error.c (syserr_initialize): set the encoding of Errno::*#message
|
||||||
|
as locale. [ruby-dev:42358]
|
||||||
|
|
||||||
Mon Oct 11 06:38:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
Mon Oct 11 06:38:27 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/stringio/stringio.c (strio_set_encoding):
|
* ext/stringio/stringio.c (strio_set_encoding):
|
||||||
|
1
error.c
1
error.c
@ -1057,6 +1057,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
|
|||||||
else {
|
else {
|
||||||
mesg = rb_str_new2(err);
|
mesg = rb_str_new2(err);
|
||||||
}
|
}
|
||||||
|
rb_enc_associate(mesg, rb_locale_encoding());
|
||||||
rb_call_super(1, &mesg);
|
rb_call_super(1, &mesg);
|
||||||
rb_iv_set(self, "errno", error);
|
rb_iv_set(self, "errno", error);
|
||||||
return self;
|
return self;
|
||||||
|
@ -312,4 +312,8 @@ end.join
|
|||||||
e = assert_raise(NoMethodError) {str.__send__(id)}
|
e = assert_raise(NoMethodError) {str.__send__(id)}
|
||||||
assert_equal("undefined method `#{id}' for #{str.inspect}:String", e.message, bug3237)
|
assert_equal("undefined method `#{id}' for #{str.inspect}:String", e.message, bug3237)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_errno
|
||||||
|
assert_equal(Encoding.find("locale"), Errno::EINVAL.new.message.encoding)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user