我想解码以下字符串:
电话\u028c\u02c8m\u0251\u0279o\u028a\u032f
它应该是来自http://rhymebrain.com/talk?function=getWordInfo&word=tomorrow的JSON字符串中给定的“明天”的IPA
我的理解是应该是:
x = 't\u028c\u02c8m\u0251\u0279o\u028a\u032f'
print x.decode()
我尝试过here,here,here,和here(以及其他一些或多或少适用的解决方案),以及对其各部分的几种置换,但我无法使其发挥作用。在
谢谢你
在您的字符串(在Python 2.x中,您似乎正在使用)前面需要一个
u
来表示这是一个unicode字符串:如果已将字符串存储在变量中,则可以使用以下构造函数将字符串转换为unicode:
^{pr2}$相关问题 更多 >
编程相关推荐