---
generator/generator.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/generator/generator.ml b/generator/generator.ml
index 4119b04..991e3ac 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -3367,6 +3367,7 @@ and generate_ruby_c () =
#include <stdint.h>
#include <ruby.h>
+#include <ruby/encoding.h>
#include \"hivex.h\"
@@ -3657,7 +3658,8 @@ get_values (VALUE valuesv, size_t *nr_values)
| RString ->
if f_len_exists name then (
pr " size_t sz = hivex_%s_len (%s);\n" name (String.concat ",
" c_params);
- pr " VALUE rv = rb_str_new (r, sz);\n"
+ pr " VALUE rv = rb_str_new (r, sz);\n";
+ pr " rb_enc_associate (rv, rb_utf8_encoding ());";
) else
pr " VALUE rv = rb_str_new2 (r);\n";
pr " free (r);\n";
--
1.8.5.2