-
-
Save tjchambers/68830208435211855fe9f424ce8de422 to your computer and use it in GitHub Desktop.
Ruby 2.5 support for opening csv with bom|utf-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CSV | |
def self.open(file, options={}, &block) | |
encoding = options.delete(:encoding) | |
File.open(file, "r:#{encoding}") do |fd| | |
yield CSV.new(fd, options) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment