summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 8aff363b33..6b867084df 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -187,7 +187,7 @@ strio_init(int argc, VALUE *argv, struct StringIO *ptr)
ptr->flags = OBJ_FROZEN(string) ? FMODE_READABLE : FMODE_READWRITE;
break;
case 0:
- string = rb_str_new("", 0);
+ string = rb_enc_str_new("", 0, rb_default_external_encoding());
ptr->flags = FMODE_READWRITE;
break;
}