Created
December 7, 2013 12:06
-
-
Save fannheyward/7840341 to your computer and use it in GitHub Desktop.
Python Unicode 编码反解,via http://www.v2ex.com/t/92197
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 | |
Type "copyright", "credits" or "license()" for more information. | |
>>> a = u'\xb2\xe2\xca\xd4' | |
>>> b = a.encode('raw_unicode_escape') | |
>>> print b | |
测试 | |
>>> c = a.encode('latin1') | |
>>> print c | |
测试 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment