Japanese output when dealing with python in visual studio

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

Japanese output when dealing with python in visual studio
Japanese output in Python
How to not escape Japanese when dealing with json in python
Precautions when dealing with control structures in Python 2.6
Character encoding when dealing with files in Python 3
Python development in Visual Studio 2017
Python development in Visual Studio
Precautions when dealing with ROS MultiArray types in Python
Until dealing with python in Atom
Tips for dealing with binaries in Python
[Visual Studio Code] [Python] [Windows] Support for garbled Japanese characters in Python in VS Code task / debug output
Dealing with "years and months" in Python
Run Python in C ++ on Visual Studio 2017
How to hide the command prompt when running python in visual studio 2015
gRPC-Methods used when dealing with protocol buffers types in Python CopyFrom, Extend
Tips when amateurs use Flask in Visual Studio
Build Python development environment with Visual Studio Code
Run Python YOLOv3 in C ++ on Visual Studio 2017
Time when terminal disappears in Visual Studio Code
Django with Python Tools 2.2 for Visual Studio (PTVS 2.2)
Handle zip files with Japanese filenames in Python 3
Create an image with characters in python (Japanese)
[Python] Dealing with multiple call errors in ray.init
Settings for Python coding in Visual Studio Code
A note I was addicted to when running Python with Visual Studio Code
Translator in Python from Visual Studio 2017 (Microsoft Translator Text API)
Japanese can be used with Python in Docker environment
App development to tweet in Python from Visual Studio 2017
Try debugging Python on Raspberry Pi with Visual Studio.
Mailbox selection when retrieving Gmail with imaplib in python
Output log in JSON format with Python standard logging
Python development environment with Windows + Anaconda3 + Visual Studio Code
Use communicate () when receiving output in a Python subprocess
Python development environment with Windows + Python + PipEnv + Visual Studio Code
AWS SDK for Python (Boto3) development in Visual Studio 2017
Send Japanese email with Python3
Install numpy in Visual Studio 2019
I wrote python in Japanese
Scraping with selenium in Python
Working with LibreOffice in Python
Scraping with chromedriver in python
Debugging with pdb in Python
Try Python output with Haxe 3.2
Working with sounds in Python
Scraping with Selenium in Python
Tweet with image in Python
Attention when os.mkdir in Python
Combined with permutations in Python
Japanese morphological analysis with Python
Error when playing with python
I understand Python in Japanese!
Remote debugging with Visual Studio 2017
Read Fortran output in python
Get Japanese synonyms in Python
Set up a Python development environment with Visual Studio Code
How to debug the Python standard library in Visual Studio
Easy with just Python! Output Graphviz figures in draw.io format!
Do something like a Python interpreter in Visual Studio Code
Solve the Japanese problem when using the CSV module in Python.
[Selenium] Change log output destination when executing phantomjs in python3
Build Python3 for Windows 10 on ARM with Visual Studio 2019 (x86) on Windows 10 on ARM