summaryrefslogtreecommitdiff
path: root/lib/psych/nodes
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-08-24 14:20:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-08-24 14:20:11 -0700
commitfe65329ce9ece399d61dadf1610e342ff456654e (patch)
treeeaff6f7ef244df975f596914a8a214f5e94d02c9 /lib/psych/nodes
parent95fc90723bb041134c8fe3be8714e8599664ce8b (diff)
downloadpsych-fe65329ce9ece399d61dadf1610e342ff456654e.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.
Diffstat (limited to 'lib/psych/nodes')
-rw-r--r--lib/psych/nodes/node.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/psych/nodes/node.rb b/lib/psych/nodes/node.rb
index 7c040ec..2a5573a 100644
--- a/lib/psych/nodes/node.rb
+++ b/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