Home Download Buy Blog Forum Support

[Decode error - output not utf-8] Mac OSX

[Decode error - output not utf-8] Mac OSX

Postby moosh7 on Wed Jun 19, 2013 2:37 am

I'm a recent new customer (bought license) and now am starting to learn python.

This is my code
Code: Select all
#!/usr/bin/python

f = open('DataEmployees.csv')
line = f.readline()
while line:
    print line
    line = f.readline()
f.close()


I'm simply learning how to read a file and print it out line by line. I get the
[Decode error - output not utf-8]

And it shows a different portion of the file each and every time I run it.

I've googled this, looked at your forums, tried to change things like exec.py, Python.sublime-build --- nothing, still the same.

It's a bit frustrating b/c --- I hate to say this --- never have this problem with BBEdit. In fact, the only reason I'm using Sublime now is b/c it does the auto end bracket thing, and I like the UI where it shows you blocks of code. But from a reliability standpoint, it seems to not quite be there. Another problem with Sublime is when I run perl code in it, it sometimes can't find a module I'm referencing. And then in BBEdit it works. This is a secondary problem, but overall and hoping you can solve this build decoder problem otherwise this will be money wasted.

Thanks.
moosh7
 
Posts: 2
Joined: Wed Jun 19, 2013 2:31 am

Re: [Decode error - output not utf-8] Mac OSX

Postby adzenith on Wed Jun 19, 2013 6:19 pm

Are you using ST2 or ST3?
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: [Decode error - output not utf-8] Mac OSX

Postby moosh7 on Sat Jun 22, 2013 7:05 pm

Version 2.0.1 Build 2217
moosh7
 
Posts: 2
Joined: Wed Jun 19, 2013 2:31 am

Re: [Decode error - output not utf-8] Mac OSX

Postby flymuse on Sun Jul 21, 2013 3:52 pm

Just in case anyone else alights on here as I did. I was having the same issue with text files also on a Mac OS. The solution I found was to save the file as a plain text file and that resolved the error. There are ways to save/convert a csv file to UTF-8: http://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding or here: http://www.ehow.co.uk/how_8387439_save-csv-utf8.html
flymuse
 
Posts: 1
Joined: Sun Jul 21, 2013 3:38 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests