decode:将其他编码转换成unicode

    a = 'aabcde'.decode('gb2312')
    print type(a)
    b = 'bbddee'.decode('utf8')
    print type(b)

  打印结果:

<type 'unicode'>
<type 'unicode'>

encode:将unicode编码转换成其他编码

相关文章:

  • 2021-10-13
  • 2022-12-23
  • 2021-10-18
  • 2021-10-16
  • 2021-12-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
相关资源
相似解决方案