Sublime Forum

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

#1

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

This is my code

#!/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.

0 Likes

#2

Are you using ST2 or ST3?

0 Likes

#3

Version 2.0.1 Build 2217

0 Likes

#4

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

0 Likes