ascii codec cant decode byte 0xe9

后端 未结 4 493
说谎
说谎 2021-01-18 11:37

I have done some research and seen solutions but none have worked for me.

Python - 'ascii' codec can't decode byte

This didn\'t work for me. And

4条回答
  •  清酒与你
    2021-01-18 12:30

    encode = turn a unicode string into a bytestring

    decode = turn a bytestring into unicode

    since you already have a bytestring you need decode to make it a unicode instance (assuming that is actually what you are trying to do)

    output_string = '\n'.join(output_lines)
    print output_string.decode("latin1")  #now this returns unicode
    

提交回复
热议问题