HttpRequest.encoding

django.http.request.HttpRequest

  • cgi.parse_header で、Content-Typeヘッダーから content_type と content_params(dict) を取得。
  • conent_paramsに charset が入っている可能性がある
  • codecs.lookup を使って、charset の存在を確認。
  • 存在したらHttpRequest.encodingプロパティに設定する
  • 実態は, HttpRequest._encoding