Handle wrongly encoded character in Python unicode string

前端 未结 5 599
暗喜
暗喜 2020-12-06 10:01

I am dealing with unicode strings returned by the python-lastfm library.

I assume somewhere on the way, the library gets the encoding wrong and returns a unicode str

5条回答
  •  天涯浪人
    2020-12-06 10:30

    Do not str() cast to string what you've got from model fields, as long as it is an unicode string already. (oops I have totally missed that it is not django-related)

提交回复
热议问题