diff options
Diffstat (limited to 'ext/psych/lib')
-rw-r--r-- | ext/psych/lib/psych/visitors/yaml_tree.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb index 520cd7e9c2..6df1151ad7 100644 --- a/ext/psych/lib/psych/visitors/yaml_tree.rb +++ b/ext/psych/lib/psych/visitors/yaml_tree.rb @@ -205,7 +205,7 @@ module Psych quote = false style = Nodes::Scalar::ANY - if o.index("\x00") || o.count("^ -~\t\r\n").fdiv(o.length) > 0.3 + if o.index("\x00") || o.count("\x00-\x7F", "^ -~\t\r\n").fdiv(o.length) > 0.3 str = [o].pack('m').chomp tag = '!binary' # FIXME: change to below when syck is removed #tag = 'tag:yaml.org,2002:binary' |