[python-chinese] 如何匹配网络数据流中的utf8字符串?

helium helium.sun在gmail.com
星期五 九月 1 14:56:49 HKT 2006


unpack成字符串然后decode('utf-8')?


2006/9/1, Kevin Rong <kevin.rong at gmail.com>:
> 大家好。
> 最近用pcap玩起了sniffer,现在有个需求,想把网络包中的utf8字符给剥离出来。
> 大家有谁这样做过,是用struct.unpack吗?
> 我用struct.unpack('>\W+',recv_data) 能匹配一些很像是utf8的字符,可是怎么不能显示为汉字。
> 有什么建议吗?
> 谢谢!
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese


关于邮件列表 python-chinese 的更多信息