11
可能重複:
Conversion of strings like \\uXXXX in python文本使用Unicode轉義序列Python中的Unicode
嗨,假設我有串
test
'\\u0259'
注意轉義反斜線。
如何將其轉換爲相應的unicode字符串?
可能重複:
Conversion of strings like \\uXXXX in python文本使用Unicode轉義序列Python中的Unicode
嗨,假設我有串
test
'\\u0259'
注意轉義反斜線。
如何將其轉換爲相應的unicode字符串?
>>> print 'test \\u0259'.decode('unicode-escape')
test ə
+1。請注意,如果您運行python 3.x,則需要使用print(bytes('test \ u0259','ascii')。decode('unicode-escape'))'。 – 2010-10-23 14:28:10
如何在沒有'print'的情況下獲得符號**ə**? – zen11625 2013-10-14 06:54:31