use String instead of StringIO and have no encoding issue - fixes https://github.com/jruby/jruby/issues/2035