【发布时间】:2013-10-20 06:14:37
【问题描述】:
所以我试图将这一行作为模型的名称加载:
"Auf der grünen Wiese (1953)"
但我得到了错误
UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 70: invalid start byte
我在看:http://docs.python.org/2/howto/unicode.html#the-unicode-type 但我仍然不确定如何解决这个问题。我可以将其转换为带有替换/忽略错误选项的 unicode,但我认为这不是最理想的解决方案?
我还看到 django 提供了一些函数来帮助解决这些问题:https://docs.djangoproject.com/en/dev/ref/unicode/ 但我仍然不太确定如何处理它。
【问题讨论】:
标签: python django unicode encoding utf-8