What does the 'rb:bom|utf-8'
mean in:
CSV.open(csv_name, 'rb:bom|utf-8', headers: true, return_headers: true) do |csv|
I can understand that:
r
means readbom
is a file format with\xEF\xBB\xBF
at the start of a file to indicate endianness.utf-8
is a file format
But:
- I don't know how they fits together and why is it necessary to write all these for reading a csv
- I'm struggling to find the documentation for
this. It doesn't seem to be documented in
https://ruby-doc.org/stdlib-2.6.1/libdoc/csv/rdoc/CSV.html
Update:
Found a very useful documentation: https://ruby-doc.org/core-2.6.3/IO.html#method-c-new-label-Open+Mode