Apache HTMLファイルが、UTF-8で送信されてしまう
ナビゲーションに移動
検索に移動
Apache HTMLファイルが、UTF-8で送信されてしまう
HTMLファイル自体のcharsetをShift_JIS等としても、ブラウザ側で、エンコーディングが、UTF-8と判定されてしまう。
html
- <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
AddDefaultCharset
レスポンスのコンテントタイプが text/plain あるいは text/html の場合に限り、レスポンスに追加するメディアタイプの文字セットパラメータ (文字エンコーディングの名前) のデフォルト値を、このディレクティブで指定。
telnetで確認
- # telnet 192.168.0.5 80
- Trying 192.168.0.5...
- Connected to 192.168.0.5 (192.168.0.5).
- Escape character is '^]'.
- GET /tipslib/index.html HTTP/1.1
- host:typea.dip.jp
/etc/httpd/conf/httpd.conf の AddDefaultCharsetをコメントアウトする
- #
- # Specify a default charset for all content served; this enables
- # interpretation of all content as UTF-8 by default. To use the
- # default browser choice (ISO-8859-1), or to allow the META tags
- # in HTML content to override this choice, comment out this
- # directive:
- #
- #AddDefaultCharset UTF-8
© 2006 矢木浩人