aboutsummaryrefslogtreecommitdiffstats
path: root/ext/psych/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych/nodes/node.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index 7c040ec463..2a5573a2bd 100644
--- a/ext/psych/lib/psych/nodes/node.rb
+++ b/ext/psych/lib/psych/nodes/node.rb
@@ -41,7 +41,7 @@ module Psych
#
# See also Psych::Visitors::Emitter
def to_yaml io = nil, options = {}
- real_io = io || StringIO.new
+ real_io = io || StringIO.new(''.encode('utf-8'))
Visitors::Emitter.new(real_io, options).accept self
return real_io.string unless io