diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 03:49:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-07 03:49:14 +0000 |
commit | c53464c7e96c1455d1ed957766d6b8d206442d76 (patch) | |
tree | 145021d0ff0d81ef8187baaf528e0b7687592539 /symbol.c | |
parent | 135c75727d44d84422355465a42f8e9c485e8f79 (diff) |
symbol.c: preserve encoding
* symbol.c (rb_check_id, rb_check_symbol): preserve encoding of
the given name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -963,9 +963,8 @@ rb_check_id(volatile VALUE *namep) else if (!RB_TYPE_P(name, T_STRING)) { tmp = rb_check_string_type(name); if (NIL_P(tmp)) { - tmp = rb_inspect(name); - rb_raise(rb_eTypeError, "%s is not a symbol nor a string", - RSTRING_PTR(tmp)); + rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol nor a string", + name); } name = tmp; *namep = name; @@ -996,9 +995,8 @@ rb_check_symbol(volatile VALUE *namep) else if (!RB_TYPE_P(name, T_STRING)) { tmp = rb_check_string_type(name); if (NIL_P(tmp)) { - tmp = rb_inspect(name); - rb_raise(rb_eTypeError, "%s is not a symbol nor a string", - RSTRING_PTR(tmp)); + rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol nor a string", + name); } name = tmp; *namep = name; |