Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns the Encoding object that represents the encoding of obj.
 
               VALUE
rb_obj_encoding(VALUE obj)
{
    int idx = rb_enc_get_index(obj);
    if (idx < 0) {
	rb_raise(rb_eTypeError, "unknown encoding");
    }
    return rb_enc_from_encoding_index(idx & ENC_INDEX_MASK);
}
            

Was this page useful?