Skip to content

Commit

Permalink
make RBX compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
tlewin committed Oct 16, 2013
1 parent 3503301 commit 1f105d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/iconv/iconv.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ map_charset(VALUE *code)
VALUE val = StringValue(*code); VALUE val = StringValue(*code);


if (RHASH_SIZE(charset_map)) { if (RHASH_SIZE(charset_map)) {
st_data_t data; VALUE data;
VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0); VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0);
StringValuePtr(key); 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; *code = (VALUE)data;
} }
} }
Expand Down

0 comments on commit 1f105d3

Please sign in to comment.