LoginSignup
0
0

More than 3 years have passed since last update.

CSVの文字コードを指定する方法(CSVファイルを出力した時に、エクセルで開いた時の文字化けを防ぐ)

Last updated at Posted at 2018-10-18

CSVファイルを出力した時に、エクセルで開いた時の文字化けを防ぐ

CSV.generateの引数に下記を付けるだけ。
(encoding: Encoding::SJIS, row_sep: "\r\n", force_quotes: true)
Shift_JISにすると文字化けすることなく表示される。

参考:
https://qiita.com/wada811/items/8b73f633f77c0466e9da

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0