Opening non-utf-8 csv file Python 3
<p>I have a csv file that is not <code>utf-8</code> encoded. And it seems impossible to open it in Python 3. I've tried all kinds of <code>.encode()</code> <code>Windows-1252</code>, <code>ISO-8859-1</code>, <code>latin-1</code> â every time I get</p>

<pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 279: invalid start byte
</code></pre>

<p>The <code>0xfc</code> byte is the German <code>Ã¼</code></p>

<p>I concede that my judgment is impaired since I was fighting with this issue for a long time now. What am I missing? I've always had problems with unicode in Python, but this one just seems especially stubborn.</p>

<p>This is the first time I try to work with Python 3 and as far as I understand there is no <code>.decode()</code> anymore, which could have solved the issue in the second.</p>

<p>EDIT:
code to open file:</p>

<pre><code>import unicodecsv as csv
csv.reader(open('myFile.csv', 'r'), delimiter = ';')
</code></pre>

<p>Simply specify encoding when <strong>opening</strong> the file:</p>

<pre><code>with open("xxx.csv", encoding="latin-1") as fd:
    rd = csv.reader(fd)
    ...
</code></pre>

<p>or with your own code:</p>

<pre><code>csv.reader(open('myFile.csv', 'r', encoding='latin1'), delimiter = ';')
</code></pre>

python csv utf-8