LoginSignup
1
0

More than 5 years have passed since last update.

SublimeTextのPythonでUnicodeEncodeErrorが発生した場合の対処

Posted at

SublimteText上でPython実行してたら、日本語データを取り扱ったとたんにUnicodeEncodeErrorが発生した。

標準のpythonではなく、pyenv経由でインストールしたpythonを使うために個別にbuildの設定をしてたんだけど、そこに日本語に対する設定がされていなかったのが問題だった。

Pyenv.sublime-buildの設定

{
    "cmd": ["/hoge/.pyenv/shims/python", "$file"],
    "selector": "source.python",
    "env": {"LANG": "ja_JP.UTF-8"},
    "file_regex": "file \"(...*?)\", line ([0-9]+)"
}
1
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
1
0