ruby/ext/-test-/string/enc_dummy.c
2023-01-11 13:41:41 +01:00

15 lines
370 B
C

#include "ruby.h"
#include "ruby/encoding.h"
VALUE
bug_rb_define_dummy_encoding(VALUE self, VALUE name)
{
int idx = rb_define_dummy_encoding(RSTRING_PTR(name));
return rb_enc_from_encoding(rb_enc_from_index(idx));
}
void
Init_string_enc_dummy(VALUE klass)
{
rb_define_singleton_method(klass, "rb_define_dummy_encoding", bug_rb_define_dummy_encoding, 1);
}