This is the first post. Also, since python is also a beginner, I'm sorry if I have the wrong knowledge.
In the main subject, when outputting Japanese to the console with Python in Visual Studio, simply convert the character code to "" aiueo ".encode ('utf-8')" or "u" aiueo "" I got an error in my environment just by writing like this.
After investigating various things, it seems that the character code of the python file must be set to utf-8.
In the Japanese version of Visual Studio, the initial character code when creating a pytho file seems to be shift-jis, and if you change the setting of the python file to "File-> Advanced save option settings-> Encoding to utf-8" You can now output Japanese safely.
However, it seems that the initial setting of the character code of the file cannot be changed from shift-jis to utf-8, so the above procedure is required every time when dealing with Japanese.
Recommended Posts