字符串str的编码方式为utf-8,转化为gbk,分为两步 1. str=str.decode('utf-8') 2. str=str.encode('gbk') 转载于:https://www.cnblogs.com/meredith/p/3423415.html