-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UrlFetchTitle: title のエンコーディングを適切に変換する #44
Comments
|
変換元の文字コードを特定するなら、持ってきたHTMLにあるMETAタグか、HTTPヘッダの中から情報をとってくる方が確実だ(HTTPプロトコル的に正しい?)と思います。 |
@raa0121 @koi-chan |
@koi-chan |
fixed #44 charlock_holmes という gem を使って文字コードを自動判別し、Nokogiri にそれを伝える。 文字コードの UTF-8 への変換は Nokogiri が自動的に行う。
@ochaochaocha3 |
Google 検索のような Shift_JIS のページを読み込んだとき、title の内容が UTF-8 に変換されないため、文字化けが起こる。そこで、brianmario/charlock_holmes という gem を使って文字コードを自動判別し、UTF-8 に変換するようにする。
参考:Ruby 1.9で文字コードの自動判別を行う – @masuidrive blog
The text was updated successfully, but these errors were encountered: