summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 03:49:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-07 03:49:14 (GMT)
commitc53464c7e96c1455d1ed957766d6b8d206442d76 (patch)
tree145021d0ff0d81ef8187baaf528e0b7687592539 /symbol.c
parent135c75727d44d84422355465a42f8e9c485e8f79 (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.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/symbol.c b/symbol.c
index 63064d3..9fbe3dd 100644
--- a/symbol.c
+++ b/symbol.c
@@ -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;