utf8转换临时方法

来源:互联网 发布:js时间差 编辑:程序博客网 时间:2024/06/14 10:01

用python,很快速的获取文本的utf8编码


Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> str='复制'

>>> str.decode('utf8')
u'\u590d\u5236'
>>>