Skip to content

Instantly share code, notes, and snippets.

@vmi
Last active September 10, 2019 04:16
Show Gist options
  • Save vmi/e78149084a4fbff6547bd8b31b9b2a7f to your computer and use it in GitHub Desktop.
Save vmi/e78149084a4fbff6547bd8b31b9b2a7f to your computer and use it in GitHub Desktop.
Snippet of reading Excel CSV (ja) by Ruby.
#!/usr/bin/ruby
require 'csv'
### Anothor implementation:
# Encoding.default_internal = Encoding::UTF_8
# CSV.foreach(filename, encoding: Encoding::CP932) do |row| ...
CSV.foreach(filename, encoding: "CP932:UTF-8") do |row|
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment