Home Download Buy Blog Forum Support

Decode error - output not utf-8

Decode error - output not utf-8

Postby bbolzano on Mon Jan 31, 2011 10:30 am

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.
Code: Select all
on Windows 7, I get this error message in the output window:

Code: Select all
[Decode error - output not utf-8][Finished]

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

Posts: 1
Joined: Mon Jan 31, 2011 10:18 am

Re: Decode error - output not utf-8

Postby jps on Mon Jan 31, 2011 12:52 pm

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 http://docs.python.org/library/codecs.h ... -encodings


Code: Select all
   "cmd": ["python", "-u", "$file"],
   "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
   "selector": "source.python",
   "encoding": "cp1252"
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: Decode error - output not utf-8

Postby Psycho_Dad on Sat Sep 17, 2011 11:49 am

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?
Posts: 1
Joined: Sat Sep 17, 2011 11:43 am

Re: Decode error - output not utf-8

Postby bussiere on Fri Feb 24, 2012 10:41 pm

Idem for me with erlang on windows.

Posts: 4
Joined: Fri Feb 24, 2012 10:40 pm

Re: Decode error - output not utf-8

Postby klor on Fri Dec 28, 2012 12:11 pm

This PHP scripts also fails (saved with encoding: UFT-8):
Code: Select all
echo utf8_decode("æøå");
// Output: [Decode error - output not utf-8] [Finished in 0.1s]
Posts: 1
Joined: Fri Dec 28, 2012 12:08 pm

Re: Decode error - output not utf-8

Postby Qwerty on Tue Feb 12, 2013 2:10 pm

This worked for me (Python) http://stackoverflow.com/a/14833803/985454
..but maybe it is common.
Posts: 6
Joined: Tue Feb 12, 2013 12:19 pm

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], Yahoo [Bot] and 12 guests