How to solve UnicodeDecodeError in Python 3.6?

前端 未结 5 2033
花落未央
花落未央 2021-01-02 15:58

I am switched from Python 2.7 to Python 3.6.

I have scripts that deal with some non-English content.

I usually run scripts via Cron and also in Terminal.

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-02 16:52

    I mean you could write an custom function like this: (Not optimal i know)


    import sys
    
    def printUTF8(input):
        print(input.encode("utf-8"))
    

提交回复
热议问题