I want to change the preferred encoding from US-ASCII to UTF-8 in Sublime Text 3 on Yosemite. The preferred encoding in the bash is set to UTF-8 so when python is run in the terminal:
import locale
print(locale.getpreferredencoding())
the output is: UTF-8
When the same code is run in Sublime Text, the output is US-ASCII
.
Setting in the build system for Python 3:
"encoding": "UTF-8"
or
"env": {"PYTHONIOENCODING": "utf-8}
has not helped.
How can the setting be changed permanently so that I don't have to call locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
in a script as a fix.