method
list
v1_9_3_392 -
Show latest stable
- Class:
Iconv
list()public
Iterates each alias sets.
static VALUE
iconv_s_list(void)
{
#ifdef HAVE_ICONVLIST
int state;
VALUE args[2];
args[1] = rb_block_given_p() ? 0 : rb_ary_new();
iconvlist(list_iconv, args);
state = *(int *)args;
if (state) rb_jump_tag(state);
if (args[1]) return args[1];
#elif defined(HAVE___ICONV_FREE_LIST)
char **list;
size_t sz, i;
VALUE ary;
if (__iconv_get_list(&list, &sz)) return Qnil;
ary = rb_ary_new2(sz);
for (i = 0; i < sz; i++) {
rb_ary_push(ary, rb_str_new2(list[i]));
}
__iconv_free_list(list, sz);
if (!rb_block_given_p())
return ary;
for (i = 0; i < RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
#endif
return Qnil;
} Related methods
- Instance methods
- close
- conv
- discard_ilseq=
- discard_ilseq?
- iconv
- transliterate=
- transliterate?
- trivial?
- Class methods
- charset_map
- conv
- ctlmethods
- iconv
- list
- new
- open