You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: encoding_capable.rs
    path of file: ./repos/magnus/tests
    
    the code of the file until where you have to start completion: use magnus::prelude::*;

#[t
    
fn it_works_across_type() {
    let ruby = unsafe { magnus::embed::init() };

    assert!(ruby.str_new("example").enc_get() == ruby.utf8_encindex());

    assert!(ruby.sym_new("example").enc_get() == ruby.usascii_encindex());
    assert!(ruby.to_symbol("example").enc_get() == ruby.usascii_encindex());

    // symbol upgrades to utf8 when required
    assert!(ruby.sym_new("ğŸ¦€").enc_get() == ruby.utf8_encindex());
    assert!(ruby.to_symbol("ğŸ¦€").enc_get() == ruby.utf8_encindex());

    let regexp = ruby.reg_new("example", Default::default()).unwrap();
    assert!(regexp.enc_get() == ruby.usascii_encindex());

    // regexp also upgrades to utf8 when needed
    let regexp = ruby.reg_new("ğŸ¦€", Default::default()).unwrap();
    assert!(regexp.enc_get() == ruby.utf8_encindex());
}