title: Ruby CSV.parse very picky when encountering quotes
body: <p>I am finding the CSV parsing in Ruby 1.9.3 to be remarkably fragile. So much so that I am wondering if I am doing something wrong</p>
  
  <p>If I do the following in irb I get an error:</p>
  
  <pre><code>1.9.3-p125 :011 &gt; require 'csv'
   =&gt; true
  1.9.3-p125 :012 &gt; a = 'one,two,three, "four, five",six'
   =&gt; "one,two,three, \"four, five\",six" 
  1.9.3-p125 :013 &gt; arr = CSV.parse(a)
  CSV::MalformedCSVError: Illegal quoting in line 1.
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1925:in `block (2 levels) in shift'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1887:in `each'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1887:in `block in shift'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1849:in `loop'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1849:in `shift'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1791:in `each'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1805:in `to_a'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1805:in `read'
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/csv.rb:1379:in `parse'
      from (irb):13
      from /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>I've found that the problem is the extra space preceding the "four, five" value. If I remove the space, then it works.</p>
  
  <pre><code>1.9.3-p125 :010 &gt; a = 'one,two,three,"four, five",six'
   =&gt; "one,two,three,\"four, five\",six" 
  1.9.3-p125 :011 &gt; arr = CSV.parse(a)
   =&gt; [["one", "two", "three", "four, five", "six"]]
  </code></pre>
  
  <p>Spaces in front of the other values does not cause a problem. The following parses just fine</p>
  
  <pre><code>one, two, three,"four, five", six
  </code></pre>
  
  <p>Is there some parse option I am missing that makes using quoted values so fragile?</p>