Ruby to_yaml utf8 string

ruby, to-yaml, utf-8, yaml

Solution

This is probably a really bad idea as I'm sure YAML has its reasons for encoding the characters as it does, but it doesn't seem too hard to undo:

require 'yaml'
require 'yaml/encoding'

text = "Ça va bien?"

puts text.to_yaml(:Encoding => :Utf8) # => --- "\xC3\x87a va bien?"
puts YAML.unescape(YAML.dump(text)) # => --- "Ça va bien?"

Problem

How can I make ruby to_yaml method to store utf8 strings with original signs but not escape sequence?

Original source