0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Firefox] 文字化けの原因をレスポンスヘッダーから確認する

Last updated at Posted at 2020-06-12

Firefoxブラウザで文字コード確認

1.Firefoxのハンバーガーアイコンから「ウェブ開発」をクリック

2.「ネットワーク」をクリック

3.「キャッシュを無効化」をチェック

4.文字化けするページをFirefoxで開く

5.該当ページのファイルをリストから選択

6.右に表示されるヘッダーにある応答ヘッダーの「Content-Type」から文字コードを確認します。

以上でレスポンス(応答)ヘッダーが示す文字コードが「charset=UTF8」となっていることが確認できました。

今回のソースは Shift_JIS の文字コードを返すよう作られていたので不一致であることが分かりました。

対策

  • Webサーバー側でレスポンスヘッダーが Shift_JIS となるよう設定する
  • ソースや各データの文字コードを UTF-8 に変換・作り変える

おわりに

レスポンスヘッダーは文字コード以外にも多くの情報が含まれるのでその他のトラブルシューティングに活用できます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?