Skip to content

Commit

Permalink
Merge pull request #3 from tlewin/rbx
Browse files Browse the repository at this point in the history
make RBX compatible
  • Loading branch information
nurse committed Oct 16, 2013
2 parents 3503301 + 1f105d3 commit 755d3d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/iconv/iconv.c
Expand Up @@ -219,10 +219,11 @@ map_charset(VALUE *code)
VALUE val = StringValue(*code);

if (RHASH_SIZE(charset_map)) {
st_data_t data;
VALUE data;
VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0);
StringValuePtr(key);
if (st_lookup(RHASH_TBL(charset_map), key, &data)) {
data = rb_hash_aref(charset_map, key);
if(!NIL_P(data)) {
*code = (VALUE)data;
}
}
Expand Down

0 comments on commit 755d3d9

Please sign in to comment.