8
8

More than 5 years have passed since last update.

Nokogiriでiso-8859-1で文字化けする場合の問題の解消方法

Last updated at Posted at 2014-05-07

下記のスニペットで今のところうまくいっている。何か問題があったら更新する。

def url2text(url)
  html = open(url).read
  doc = Nokogiri::HTML(html.toutf8, nil, 'utf-8')
  doc.text
end
8
8
1

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
8
8