Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
示例我有这个文本字符串:
string = 'Vui lòng giúp đỡ tôi'
如何将其转换为整数以与 unichr() 一起使用?
示例结果:
\u...\u...
你不需要,如果你解码它。
>>> 'Vui lòng giúp đỡ tôi' 'Vui l\xc3\xb2ng gi\xc3\xbap \xc4\x91\xe1\xbb\xa1 t\xc3\xb4i' >>> 'Vui lòng giúp đỡ tôi'.decode('utf-8') u'Vui l\xf2ng gi\xfap \u0111\u1ee1 t\xf4i' >>> print 'Vui lòng giúp đỡ tôi'.decode('utf-8') Vui lòng giúp đỡ tôi