The rb_str_new method we have is good for making C strings in to Ruby string objects. From here we can go further and implement the string with rb_str_initialize to help also set the encoding.
So I believe we should add the method rb_enc_associate to ruby_sys. We'll also likely need to implement encoding structs and have a C rb_encoding type mapped to ruru::Encoding.
typedef const OnigEncodingType rb_encoding;
The obvious places to look are string.c, encoding.c and encoding.h. But the OnigEncodingType (onigmo.h) is a C Regex thing for helping with encodings so I don't know how complex that would be.
The
rb_str_new
method we have is good for making C strings in to Ruby string objects. From here we can go further and implement the string withrb_str_initialize
to help also set the encoding.So I believe we should add the method
rb_enc_associate
to ruby_sys. We'll also likely need to implement encoding structs and have a Crb_encoding
type mapped toruru::Encoding
.The obvious places to look are
string.c
,encoding.c
andencoding.h
. But theOnigEncodingType
(onigmo.h
) is a C Regex thing for helping with encodings so I don't know how complex that would be.