python的一些问题

  1. 对于字符编码的问题
gbk的编码样子
content = '\xcb\xce\xce\xb0\xd0\xc0'
content.encode("latin1").decode("gbk")

得到结果:'宋伟欣'

https://blog.csdn.net/lxdcyh/article/details/4018054
https://www.cnblogs.com/ludingchao/p/11814195.html

猜你喜欢

转载自www.cnblogs.com/0916m/p/12519272.html