Skip to content

Instantly share code, notes, and snippets.

@murajun1978
Last active December 14, 2015 22:29
Show Gist options
  • Save murajun1978/5158813 to your computer and use it in GitHub Desktop.
Save murajun1978/5158813 to your computer and use it in GitHub Desktop.
RubyでCSVファイルをShift-JISからUTF-8へエンコード
require 'csv'
file_path = ARGV[0]
CSV.foreach(file_path, encoding: 'SJIS:UTF-8') do |row|
p row
end
arr = %w[ Apple Google Facebook Twitter ]
p arr #=> ["Apple", "Google", "Facebook", "Twitter"]
p arr.join(", ") #=> "Apple, Google, Facebook, Twitter"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment