summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 11:58:11 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 11:58:11 +0000
commit6f99342c92055f8a891d889fb99ab7f131962977 (patch)
treecdf6dbf3e8f948340863e4d2c9e520e4233d1328 /encoding.c
parent1f262b3ef4e00fe8a7e84ab524ba53deeae1a07c (diff)
* encoding.c (enc_find): check type of argument and convert to String
if it is StringValue. [ruby-cvs:22866] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index 19343ea7c99..6cf32a81dfc 100644
--- a/encoding.c
+++ b/encoding.c
@@ -902,7 +902,7 @@ enc_find(VALUE klass, VALUE enc)
{
int idx;
- if (SYMBOL_P(enc)) enc = rb_id2str(SYM2ID(enc));
+ StringValue(enc);
if (!rb_enc_asciicompat(rb_enc_get(enc))) {
rb_raise(rb_eArgError, "invalid name encoding (non ASCII)");
}