lib/csv2qif/processor.rb in csv2qif-0.0.2 vs lib/csv2qif/processor.rb in csv2qif-0.0.4
- old
+ new
@@ -10,10 +10,11 @@
def process stdin, stdout, arguments, options
if arguments.empty?
process_file stdin, stdout, options
else
arguments.each do |file|
- stream_in = File.open(file, "r")
+ mode = ['r', options[:encoding]].compact.join(':')
+ stream_in = File.open(file, mode)
stream_out = File.new esub(file, :csv, :qif), "w"
begin
process_file stream_in, stream_out, options
ensure
stream_in.close
\ No newline at end of file