Skip to content

Instantly share code, notes, and snippets.

@shinchit
Last active August 29, 2015 14:03
Show Gist options
  • Save shinchit/26fb8e0e0c41a8dd8c03 to your computer and use it in GitHub Desktop.
Save shinchit/26fb8e0e0c41a8dd8c03 to your computer and use it in GitHub Desktop.
Javaによる出力文字コードの指定
// リクエストボディの文字コードを特定のコード(ここではShift_JIS)に指定
request.setCharacterEncoding("Shift_JIS");
// レスポンス(サーバの出力文字列)の文字コードとレスポンスヘッダを特定のコード(ここではShift_JISに指定)
response.setContentType("text/html; charset=Shift_JIS");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment