#!/usr/bin/env python
# -*- coding:utf-8 -*-
#UTF-8 to GBK encoding
#temp
#decode
#encode
#The principle is to convert UTF-8 into Wanguo code, and then encode and convert Wanguo code into GBK. This is how it is used in python
"""
Assigning the variable temp equals 'Li Jie' is UTF-8 encoding!
The assignment of the variable temp_unicode is equal to the decoding of the temp variable. The original encoding of the specified temp is UTF-8
Get the temp_unicode variable, encode and specify it as gbk, and the assignment of temp_gbk is obtained
temp_gbk is the compiled GBK content, print(temp_gbk) is to display the previous UTF-8 encoding 'Zhang San' in gbk
"""
temp = 'Zhang San'# UTF-8
#Decode, you need to specify what encoding it is
temp_unicode =('utf-8')
#Encode for encoding
temp_gbk = temp_unicode.encode('gbk')
# When printing again, I want to display it in GBK. The terminal of Windows happens to be GBK encoding, and the two match
#temp_gbk is the compiled GBK content, print(temp_gbk) is displayed in gbk
print(temp_gbk)