GAE1.3.1上传中文数据编码问题解决

http://code.google.com/p/googleappengine/issues/detail?id=157

 

Comment 18 by kevingdonApr 13, 2009

The new bulkloader can be used to load unicode data, but you need to set up your
Loader subclass properly.  You can use something like "lambda x: unicode(x, 'utf-8')"
as your conversion function to make it work.  e.g.

class MyModel(db.Model):
  field1 = db.StringProperty()

class MyLoader(Loader):
  def __init__(self):
    Loader.__init__(self, 'MyModel', [('field1', lambda x: unicode(x, 'utf-8'))])

你可能感兴趣的:(Google,UP)