http://www.hurring.com/scott/code/python/serialize/
官方(0.4b)尚未出该BUG修正.
对于数据类型是 types.UnicodeType 的数据 Serialize 操作时,报错:
Exception: Unknow / Unhandled data type (<type 'unicode'>)!
修正方案:
在 def serialize_value(self, data): 定义里, 添加 types.UnicodeType 数据类型支持.
# Unicode => string
if type(data) is types.UnicodeType :
data = data.encode('utf-8')
return "s:%i:\"%s\";" % (len(data), data);
发表于 @ 2007年10月27日 09:41:00|评论(loading...)|编辑