Actions
Bug #9582
closedCSV#headers not giving expected results.
Description
It seems something not working as expected in CSV. I tried to find the reason here , http://rxr.whitequark.org/mri/source/lib/csv.rb but I failed.
require 'csv'
content = <<_
key,fr
edit,Éditer
close,Fermer
_
File.write('test',content)
file = CSV.read('test', :headers => true)
file.headers # => ["key", "fr"]
file.to_a # => [["key", "fr"], ["edit", "Éditer"], ["close", "Fermer"]]
content = <<_
key,fr
edit,Éditer
close,Fermer
_
File.write('test1',content)
file = CSV.read('test1', :headers => true)
file.headers # => [] # <~~~~~~~~~~~ Is this a bug ?
file.to_a # => [[], [], ["edit", "Éditer"], ["close", "Fermer"]]
Files
Actions
Like0
Like0Like0Like0