标签列表
在Python中从二进制数据中获取Unicode字符串
python
networking
unicode
decoding
3
3
我有一些从服务器接收到的普通字符串中的UCF-2数据。如何将其转换为unicode()字符串?
例如:
>>> something('\0a\0b\0c')
=
u'abc'
-
0x1_c0de_bad
1
1
我认为他的意思是“UCS-2”,但需要确认。
- torek
1
个回答
4
4
>>
>
'\0a\0b\0c'
.decode(
'UTF-16BE'
) u
'abc'
-
dan04
回答链接
网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接
相关问题
10
在Python中遍历Unicode字符串
3
在Python中从文本文件中剥离二进制数据
5
Python - 将二进制文件中的宽字符字符串转换为Python Unicode字符串
3
在Python中从Unicode字符串中移除HTML标记
19
Python获取Unicode字符串大小
6
在Python中转换Unicode字符串
3
如何在PHP中从Unicode字符串中获取Unicode字符
11
在Python中从Unicode字符串获取字节
6
在Python中转义Unicode字符串
3
如何在Python中提取数据时获取Unicode字符串?