我有以下代码是用Python 2.7编写的:
# -*- coding: utf-8 -*-
import sys
_string = "años luz detrás"
print _string.encode("utf-8")
这会抛出以下错误:
print _string.encode("utf-8")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
非常感谢您的帮助!