For the time being, I was using Django to output from the DB, but it doesn't seem to work. So a bug fix note.
[Be careful of LANG for UnicodeEncodeError when printing Japanese in Python 3] (https://qiita.com/toshihikoyanase/items/47407551d8f3d4e8c39a)
According to this article, Python3 ** changes the character code used depending on the environment variables of the OS ** I'm using Sakura VPS, but Sakura's Ubuntu doesn't include the Japanese package by default, so UTF8 is on the DB side and Latin1 is on the Python console. It seems that a character code error occurred in the Python console
So, let's change the default locale for Ubuntu!
''' % sudo apt-get install language-pack-ja % sudo update-locale LANG=ja_JP.UTF-8 % sudo reboot '''
For the time being, the text works
Recommended Posts