First and possibly most important, the CSV implementation is completely
different on 1.8 and 1.9, and I’m not sure that the original 1.8.7
version
supports Unicode at all. So while the TypeError is a little bit
cryptic,
I’m not sure I can provide a better explanation.
The error under 1.9.2 is because you didn’t specify an :encoding in your
call to generate. This works under 1.9.2 on my machine:
csv_string = CSV.generate(:col_sep => “\t”, :encoding => “UTF-8”) do
|csv|
csv << [“row”, “of”, “CSV”, “data”]
csv << [“test”, “ação”]
end