diff options
-rw-r--r-- | ext/stringio/stringio.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -20,6 +20,7 @@ STRINGIO_VERSION = "3.1.8.dev"; #include "ruby.h" #include "ruby/io.h" #include "ruby/encoding.h" #if defined(HAVE_FCNTL_H) || defined(_WIN32) #include <fcntl.h> #elif defined(HAVE_SYS_FCNTL_H) @@ -1864,7 +1865,12 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self) } } ptr->enc = enc; - if (!NIL_P(ptr->string) && WRITABLE(self)) { rb_enc_associate(ptr->string, enc); } |