とみたです。

1.8 で問題ない CSV データを 1.9 で CSV.parse するとエラーになることがあ
ります。

どうやら " で括られた中に、レコード末尾の改行コードと異なる改行コードが
ある場合の処理がおかしいようです。

$ ruby1.8 -v -rcsv -e 'p CSV.parse("\"a\nb\"\r\n")'
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
[["a\nb"]]

$ ruby1.9 -v -rcsv -e 'p CSV.parse("\"a\nb\"\r\n")'
ruby 1.9.0 (2007-12-25 revision 14709) [i686-linux]
/usr/local/lib/ruby/1.9.0/csv.rb:1607:in `raise': Unclosed quoted field on line 1. (CSV::MalformedCSVError)
        from /usr/local/lib/ruby/1.9.0/csv.rb:1607:in `block in shift'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1527:in `loop'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1527:in `shift'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1472:in `each'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1483:in `to_a'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1483:in `read'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1220:in `parse'
        from -e:1:in `<main>'

$ ruby1.9 -rcsv -e 'p CSV.parse("\"a\r\nb\"\n")'
/usr/local/lib/ruby/1.9.0/csv.rb:1607:in `raise': Unclosed quoted field on line 1. (CSV::MalformedCSVError)
        from /usr/local/lib/ruby/1.9.0/csv.rb:1607:in `block in shift'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1527:in `loop'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1527:in `shift'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1472:in `each'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1483:in `to_a'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1483:in `read'
        from /usr/local/lib/ruby/1.9.0/csv.rb:1220:in `parse'
        from -e:1:in `<main>'

$ ruby1.9 -rcsv -e 'p CSV.parse("\"a\nb\"\n")'
[["a\nb"]]

$ ruby1.9 -rcsv -e 'p CSV.parse("\"a\r\nb\"\r\n")'
[["a\r\nb"]]

-- 
とみたまさひろ <tommy / tmtm.org>
3469 42CC 4D32 F53C AD98  65A5 8C37 FF09 69C1 6040