Sublime Forum

Decode error - output not utf-8

#1

Hello, and thank you for making such a great editor! I am currently testing Linux and Windows versions of ST2. When building (F7) a simple python script, ie. print("hello") on Windows 7, I get this error message in the output window:

[Decode error - output not utf-8][Finished]

On Ubuntu everything works as expected. Any help would be appreciated.

Bernard

0 Likes

"[Decode error - output not utf-8]" (Win7)
#2

It’s important that the output encoding of your program, and the encoding that the .sublime-build file specify match up. By default, the output encoding is assumed to be utf-8. This works for me with Python 2.6 on windows, perhaps Python 3 changes something in this area (and assuming you’re using Python 3).

You can try adding an explicit encoding line to Packages/Python/Python.sublime-build on windows, and specifying “encoding” to be perhaps cp1252 or utf16 - the full list of available options is at docs.python.org/library/codecs.h … -encodings

e.g:

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

#3

I have a similar problem (related to this same error).

I have a simple LaTeX project and I configured a build system to invoke pdflatex / latexmk which is working fine, everything compiles; however when the log file generated by the process contains non-ASCII characters I get the error “[Decode error - output not utf-8][Finished]”. This is because, the encoding of the output file changes from ASCII to latin1.

I’m aware that Sublime cannot be made responsible for other programs output, but I could not configure pdflatex / latexmk to change its output encoding… so I’m here.

Is there a solution to this? (Specifying “encoding”: “[cp1252|latin1|latin2|…]” in the build system definition does not help.)

Thanks in advance!

PS.: Is Sublime blog the right place to subscribe for receiving updates on new builds, RC’s and stuff?

0 Likes

#4

Idem for me with erlang on windows.

Regards
Bussiere

0 Likes

#5

This PHP scripts also fails (saved with encoding: UFT-8):

<?php echo utf8_decode("æøå"); // Output: [Decode error - output not utf-8] [Finished in 0.1s]

0 Likes

#6

This worked for me (Python) stackoverflow.com/a/14833803/985454
…but maybe it is common.

0 Likes