The encoding of StringIO.new

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B

e$B%9%/%j%W%H$G07$&J8;zNs$N%(%s%3!<%G%#%s%0$Oe(B default_external
e$B$r2>Dj$9$k$3$H$,e(B
e$BB?$$$G$7$g$&!#$J$N$G0z?t$J$7$Ne(B StringIO.new
e$B$,JV$9J8;zNs$N%(%s%3!<%G%#%s%0$be(B
Encoding.default_external e$B$@$H$&$l$7$$$s$G$9$,!"$I$&$G$7$g$&e(B?

Index: ext/stringio/stringio.c

— ext/stringio/stringio.c (revision 15080)
+++ ext/stringio/stringio.c (working copy)
@@ -187,7 +187,7 @@ strio_init(int argc, VALUE *argv, struct
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;
    
    }