ATOM上でCtrl+RでAtom Runnerを走らせましたが、日本語だとNGになります。
原因をご存知の方がいらっしゃればご教示ください。
Python
1# -*- coding: utf-8 -*- 2print("これはテストです")
以下のようにエラーになります。
Atom Runner: testtest.py Traceback (most recent call last): File "/Users/xxx/Documents/PythonAI/src/ch1/testtest.py", line 2, in <module> print("\u3053\u308c\u306f\u30c6\u30b9\u30c8\u3067\u3059") UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128) Running: python3 (cwd=/Users/xxx/Documents/PythonAI/src/ch1/testtest.py
ちなみに日本語をアルファベットにするとうまくいきます。
Python
1# -*- coding: utf-8 -*- 2print("ThisIsTest")
Atom Runner: testtest.py ThisIsTest
過去回答をみて、init.coffeeには下記記述を追記済みです。
process.env.PYTHONIOENCODING = "utf-8";
ちなみに、コンソールから実行したら問題ありません。
MyMAC001:ch1 xxx$ python3 testtest.py これはテストです
以下バージョンです。
MacOS 10.12.6
Atom 1.20.0
Python 3.6.1