2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

python3の標準出力でUnicodeEncodeError奮闘記

2
Last updated at Posted at 2016-11-17

標準出力をするとUnicodeEncodeError

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

デバッグがし辛かったので解決方法を調べた.

環境を日本語化する

以下の環境で解決しました.
CentOS6.5
Python3.5.2
日本語化する方法はこちら
http://d.hatena.ne.jp/yk5656/20140527/1402758009

>> print("ほげほげ")
ほげほげ

原因は単純に日本語がその環境にインストールされていなかった.
環境を日本語化することで解決.

奮闘記とはいえ,筆者がUnicodeEncodeErrorで挫折を繰り返していただけです.

Ubuntuの場合はこっちを参考にすると良さそう

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

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?