ElementTree and unicode

前端 未结 6 802
星月不相逢
星月不相逢 2020-12-06 00:38

I have this char in an xml file:


  
      fumè
  

I t

6条回答
  •  一个人的身影
    2020-12-06 01:01

    Might you have stumbled upon this problem while using Requests (HTTP for Humans), response.text decodes the response by default, you can use response.content to get the undecoded data, so ElementTree can decode it itself. Just remember to use the correct encoding.

    More info: http://docs.python-requests.org/en/latest/user/quickstart/#response-content

提交回复
热议问题