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?

powershellでエンコーディングを変更するときchcpが働かない

Posted at

chcpは使えない

powershellでencodingを変更するときchcpが働かず[Console]::OutputEncoding = [System.Text.Encoding]::UTF8を使いました。

chcpコマンドはエンコードを変更できると思っていました。
コマンドプロンプトではこの方法が使えますが、PowerShellの出力エンコーディングはそれとは別に管理されています。

エンコーディングをUTF-8へ変更したいとき

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8を使うことでエンコーディングを変更します。

現在のエンコーディングを確認するには

[Console]::OutputEncoding を使います。

クエスチョン

Macではどうなんだろう

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?