LoginSignup
46
49

More than 5 years have passed since last update.

コマンドプロンプト、Powershell の文字コードを変更する

Posted at

Windows でコマンドプロンプトを起動すると、日本語環境の場合の文字コードは CP932 (Shift_JIS)になります。
Windows でも Shift_JIS ではなく UTF-8 を使いたいことは多々あります。

そんな時は次のコマンドを実行しましょう。

chcp 65001

chcp は CHange Code Page の略で、コマンドプロンプトまたは PowerShell のコードページを確認したり変更するコマンドです。

引数なしで実行すると、設定されているコードページを表示します。
引数付きで実行すると、指定されたコードページに変更します。

参考: Code Page Identifier

46
49
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
46
49