Unicode解码错误

时间:2011-06-07 08:23:48

标签: python rdf decode

虽然我不是Python开发人员,但我创建了一些Python来将一些数据转换为RDF。

我上周在Python 3.2中运行了代码,运行正常。然而今天却给了我错误

**Traceback (most recent call last):**

**File "C:\Users\Karen\Desktop\Linked Data new\RGC_v3.2.py", line 10, in <module>
    for row in reader: #look through each row in the csv file. row is an area where row[0] will be the first column, row[1] the second etc.
  File "C:\Python32\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 754: character maps to <undefined>**

我不知道为什么这突然停止了。

1 个答案:

答案 0 :(得分:3)

您假设数据是在CP1252中编码的。检查the usual suspects以确定使用的编码。