Python print Print output Chinese display garbled code

Add the following code at the beginning

Many people said this on the Internet, but it didn't work for me

 # -*- coding: utf-8 -*- perhaps # encoding: utf-8

This works

 #Settings import io import sys sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')

Post reply

Your email address will not be disclosed. Required items have been used * tagging




Enter Captcha Here :