Issue #680 has been updated by Takeyuki Fujioka.
File sample.csv added
Please save as 'sample.csv' attached file.
This file include japanese UTF-8 string in first line.
Other line is us-ascii. Line number count is 5001.
% time ruby19 -Eutf-8 -rcsv -e 'CSV.parse(open("sample.csv","r").read)'
ruby19 -Eutf-8 -rcsv -e 'CSV.parse(open("sample.csv","r").read)' 0.23s user 0.01s system 96% cpu 0.254 total
this is OK very fast.
But:
% time ruby19 -Eeuc-jp -rcsv -e 'CSV.parse(open("sample.csv","r").read)'
/Users/fujioka/local/lib/ruby/1.9.0/csv.rb:1981:in `=~': broken EUC-JP string (ArgumentError)
from /Users/fujioka/local/lib/ruby/1.9.0/csv.rb:1981:in `init_separators'
from /Users/fujioka/local/lib/ruby/1.9.0/csv.rb:1563:in `initialize'
from /Users/fujioka/local/lib/ruby/1.9.0/csv.rb:1350:in `new'
from /Users/fujioka/local/lib/ruby/1.9.0/csv.rb:1350:in `parse'
from -e:1:in `<main>'
ruby19 -Eeuc-jp -rcsv -e 'CSV.parse(open("sample.csv","r").read)' 3.93s user 6.38s system 98% cpu 10.457 total
this result is very slow.
I hope raise as soon as encoding mismatch found .
# Sorry, I don't understand M17N's default_external and default_internal behavior.
# I can't reply about M17N's problem.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/680
----------------------------------------
http://redmine.ruby-lang.org