diff options
-rw-r--r-- | ext/stringio/stringio.c | 8 | ||||
-rw-r--r-- | test/stringio/test_stringio.rb | 7 |
2 files changed, 14 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); } @@ -1057,6 +1057,13 @@ class TestStringIO < Test::Unit::TestCase assert_equal("test", io.string) assert_same(chilled_string, io.string) end end private |