rb_str_encode

Function rb_str_encode 

Source
pub unsafe extern "C" fn rb_str_encode(
    str_: VALUE,
    to: VALUE,
    ecflags: c_int,
    ecopts: VALUE,
) -> VALUE
Expand description

Converts the contents of the passed string from its encoding to the passed one.

§@param[in] str Target string. @param[in] to Destination encoding. @param[in] ecflags A set of enum ::ruby_econv_flag_type. @param[in] ecopts A keyword hash, like ::rb_io_t::rb_io_enc_t::ecopts. @exception rb_eArgError Not fully converted. @exception [rb_eInvalidByteSequenceError] str is malformed. @exception [rb_eUndefinedConversionError] str has a character not representable using to. @exception [rb_eConversionNotFoundError] There is no known conversion from str’s encoding to to. @return A string whose encoding is to, and whose contents is converted contents of str. @note Use rb_econv_prepare_options to generate ecopts.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3