aboutsummaryrefslogtreecommitdiffstats
path: root/ext/psych/lib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 21:14:44 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 21:14:44 +0000
commit34f6671d68a3fc6d94a7ed6954b71615735fa83b (patch)
tree019f130be7623c0624b349b0399b299f6d9c2fc2 /ext/psych/lib
parent8b8c7fd386022f30f846ce7fd4c8224d61118b57 (diff)
downloadruby-34f6671d68a3fc6d94a7ed6954b71615735fa83b.tar.gz
* ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
UTF-8. * test/psych/test_encoding.rb: test yaml dump encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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