python 改变字符串的编码方式时间:2023-03-10 02:38:14 字符串str的编码方式为utf-8,转化为gbk,分为两步 1. str=str.decode('utf-8') 2. str=str.encode('gbk')