python pickler乱码问题
try:
??? from cStringIO import StringIO
except ImportError:
??? from StringIO import StringIO
try:
??? import cPickle as pickle
except ImportError:
??? import pickle
pickler=pickle.Pickler
unpickler=pickle.Unpickler
?
?
file = StringIO()
_pk = pickler(file)
val = u'中文¥200'
_pk.dump(val)
print file.getvalue()