[CENTOS] UnicodeEncodeError struggle with standard output of python3

UnicodeEncodeError when standard output

>> print("Hogehoge")
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-3: ordinal not in range(128)

It was hard to debug, so I investigated the solution.

Japaneseize the environment

It was solved in the following environment. CentOS6.5 Python3.5.2 Click here for how to translate into Japanese http://d.hatena.ne.jp/yk5656/20140527/1402758009

>> print("Hogehoge")
Hogehoge

The cause was simply that Japanese was not installed in that environment. Solved by translating the environment into Japanese.

Although it is a struggle, I just repeated frustration with UnicodeEncodeError.

In the case of Ubuntu, it seems good to refer to this

http://qiita.com/toshihikoyanase/items/47407551d8f3d4e8c39a

Recommended Posts

UnicodeEncodeError struggle with standard output of python3
[Understanding / application of with syntax] Flexible switching of Python standard output destination
Basics of python: Output
Try Python output with Haxe 3.2
Receives and outputs standard output of Python 2 and Python 3> C implementations
Get standard output in real time with Python subprocess
Output log in JSON format with Python standard logging
[For beginners] Summary of standard input in Python (with explanation)
Matrix representation with Python standard input
Output to csv file with Python
Input / output with Python (Python learning memo ⑤)
Make standard output non-blocking in Python
Comply with Python coding standard PEP8
[Note] Hello world output with python
Unit test log output with python
Life game with Python! (Conway's Game of Life)
10 functions of "language with battery" python
Implementation of Dijkstra's algorithm with python
RPC completed with standard Python3 modules
Coexistence of Python2 and 3 with CircleCI (1.0)
Basic study of OpenCV with Python
Convert to a string while outputting standard output with Python subprocess
Be careful of LANG for UnicodeEncodeError when printing Japanese with Python 3
Output the contents of ~ .xlsx in the folder to HTML with Python
Read the standard output of a subprocess line by line in Python
[Blender] List of shortcut keys of Python Console that comes standard with Blender
Basics of binarized image processing with Python
[Examples of improving Python] Learning Python with Codecademy
Calculate and display standard weight with python
Output color characters to pretty with python
Output tree structure of files in Python
Check the existence of the file with python
Algorithm learned with Python 8th: Evaluation of algorithm
Notes on standard input / output of Go
Output Python log to console with GAE
Clogged with python update of GCP console ①
Easy introduction of speech recognition with Python
1. Statistics learned with Python 1-3. Calculation of various statistics (statistics)
Drawing with Matrix-Reinventor of Python Image Processing-
Recommendation of Altair! Data visualization with Python
Comparison of matrix transpose speeds with Python
[Python] Chapter 02-03 Basics of Python programs (input / output)
CSV output of pulse data with Raspberry Pi (confirm analog input with python)
Immediate display, forced display, flash of print output result with python (mainly jupyter)
I tried to streamline the standard role of new employees with Python
I tried hundreds of millions of SQLite with python
FizzBuzz with Python3
Output the number of CPU cores in Python
Csv output from Google search with [Python]! 【Easy】
Introduction of Python
Scraping with Python
Prepare the execution environment of Python3 with Docker
Automatic operation of Chrome with Python + Selenium + pandas
Performance comparison of face detector with Python + OpenCV
2016 The University of Tokyo Mathematics Solved with Python
Scraping with Python
Algorithm learned with Python 13th: Tower of Hanoi
Python with Go
Color page judgment of scanned image with python
[Note] Export the html of the site with python.
python learning output