ext/i18nema/i18nema.c in i18nema-0.0.2 vs ext/i18nema/i18nema.c in i18nema-0.0.3
- old
+ new
@@ -1,6 +1,7 @@
#include <ruby.h>
+#include <ruby/encoding.h>
#include <syck.h>
#include "uthash.h"
VALUE I18nema = Qnil,
I18nemaBackend = Qnil,
@@ -48,10 +49,10 @@
i_object_to_robject(i_object_t *object) {
if (object == NULL)
return Qnil;
switch (object->type) {
case i_type_string:
- return rb_str_new2(object->data.string);
+ return rb_enc_str_new(object->data.string, object->size, rb_utf8_encoding());
case i_type_array:
return array_to_rarray(object);
case i_type_hash:
return hash_to_rhash(object);
}