blob: 4169552655a7e1b5cd3894fda7d3e8c148ac4128 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#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);
}
|