1
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?

More than 5 years have passed since last update.

Visual Studio for Macでコンソールの日本語が文字化け(?表示)する場合の対処

Last updated at Posted at 2020-04-22

環境

OS : macOS Catalina
Visual studio: Visual Studio 2019 for Mac Community

日本語文字化け

Visual Studio for Macの.NET、コンソールプロジェクトでコンソールに文字列を出力する際に、日本語が**??**で表示されます。

using System;
namespace Test {
    class MainClass {
        public static void Main(string[] args) {
            Console.WriteLine("ペンギン");
        }
    }
}
????

Press any key to continue...

対処

環境変数を追加します。

vim .bash_profile
.bash_profile
export LANG=ja_JP.UTF-8

再起動して、Visual Studio for Macのコンソールで日本語が正常に表示されることを確認します。

システム終了後、日本語が文字化けする場合

Visual Studio for Macでコンソールを表示する前に、ターミナルを起動すると、文字化けが直ります。

1
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
1
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?