3

我有以下导致我出现问题的行:

if "Total £" in studentfees:

返回:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 4: ordinal not in range(128)

我怎样才能解决这个问题?

提前致谢 - Hyflex

4

1 回答 1

7

您可以将以下内容添加到文件中:

# -*- coding: utf-8 -*-

还:

if u"Total £" in studentfees:
于 2013-09-27T14:31:08.253 回答