# coding=utf-8 import sys a_utf8='人生苦短' a_gbk=a_utf8.encode(GBK) print ('a_gbk')
C:\Users\zbj15010857936\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/zbj15010857936/PycharmProjects/pythonProject/main.py Traceback (most recent call last): File "C:/Users/zbj15010857936/PycharmProjects/pythonProject/main.py", line 4, in <module> a_gbk=a_utf8.encode(GBK) NameError: name 'GBK' is not defined Process finished with exit code 1