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