T
T
tvhell2014-11-30 04:52:31
Python
tvhell, 2014-11-30 04:52:31

Sublime Text 3 + Python 3 = NOT UTF-8. Why?

The notorious [Decode error - output not utf-8] under Win.
Sublime is a curiosity for me, I have been studying Python for several months.
Procedure from scratch:
- installed Sublime Text 3
- downloaded Jedi
- Tools -> Build System -> Python
I run a simple code with Cyrillic text: NOT UTF-8.
I looked at the Sublime forums, the devil will break his leg there. Found the intended solution in the form of a new Build System. I gave the file a clear name, I wrote in the file itself:

{
"cmd": ["C:\\python33\\python.exe", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}

NOT UTF-8. Just for the sake of experiment, I added the line "encoding": "utf-8". The result is the same. Added to the beginning of the code # -*- coding: utf-8 -*-. Without changes.
There must be a way to make them work together.
SOLUTION FOUND!
New Build System with the following code:
{
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "cp1251"
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ensase, 2014-11-30
@Ensase

Check that the path to python is in the PATH environment variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question