Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在保存具有非ascii字符值的文档时使用mongoengine和mongodb得到UnicodeDecodeError(mongoengine用unicode()调用包装值) 有什么办法处理它?
unicode()
如果您正在调用unicode(),您应该提供您的字符串编码的编码,以便unicode()函数知道如何转换数据。例如:
v = "myvalüe" u = unicode(v, 'utf-8')