I'm making a system with Python now, but when I registered the DB in Japanese, I encountered the following error.
error
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)
At the time of the test, I knew that Japanese was bad because it was registered normally in English. If you google the error content, you will come across the following site and solve it with haste.
index.py
import sys, codecs
# 3.5 =>
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
import io
# 3.6 =< 3.x
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
Referenced site What to do if you get a UnicodeDecodeError when executing a Python script
Recommended Posts