From 344b8bbd697ba7ade949da3968b9f5e6226f832f Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 8 Jan 2015 22:25:31 +0000 Subject: * ext/psych/lib/psych/visitors/yaml_tree.rb: correctly quote non-ascii letters. Thanks @jirutka for the patch. * test/psych/test_string.rb: test for change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/visitors/yaml_tree.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/psych') diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb index bedf9d35b2..3a6bd1da54 100644 --- a/ext/psych/lib/psych/visitors/yaml_tree.rb +++ b/ext/psych/lib/psych/visitors/yaml_tree.rb @@ -317,7 +317,7 @@ module Psych tag = 'tag:yaml.org,2002:str' plain = false quote = false - elsif o =~ /^\W[^"]*$/ + elsif o =~ /^[^[:word:]][^"]*$/ style = Nodes::Scalar::DOUBLE_QUOTED else unless String === @ss.tokenize(o) -- cgit v1.2.3