很简单,如果您的数据不在utf-8中,请不要使用utf-8编码
>>> json.loads('["x96"]')....UnipreDepreError: 'utf8' prec can't depre byte 0x96 in position 0: invalid start byte>>> json.loads('["x96"]', encoding="latin-1")[u'x96']json.loads
如果
s是str实例,并且使用utf-8(例如latin-1)以外的基于ASCII的编码进行编码,则encoding必须指定适当的
名称。不允许使用非基于ASCII的编码(例如UCS-2),并且应首先解码unipre。
编辑 :要获取正确的unipre值“ x96”,请使用“ cp1252”,如Eli Collins所述
>>> json.loads('["x96"]', encoding="cp1252")[u'u2013']


