相关疑难解决方法(0)

6
推荐指数
1
解决办法
5539
查看次数

尝试将Utf-8数据存储在数据存储区中,获取UnicodeEncodeError

尝试将utf-8存储到数据存储区并获取错误:

Traceback (most recent call last):
  File "/sinfo/google_appengine/google/appengine/ext/webapp/__init__.py", line 511, in __call__
    handler.get(*groups)
  File "/sinfo/siteinfo/siteinfo.py", line 1911, in get
    seoEntity.put()
  File "/sinfo/google_appengine/google/appengine/ext/db/__init__.py", line 833, in put
    return datastore.Put(self._entity, rpc=rpc)
  File "/sinfo/google_appengine/google/appengine/api/datastore.py", line 275, in Put
    req.entity_list().extend([e._ToPb() for e in entities])
  File "/sinfo/google_appengine/google/appengine/api/datastore.py", line 680, in _ToPb
    properties = datastore_types.ToPropertyPb(name, values)
  File "/sinfo/google_appengine/google/appengine/api/datastore_types.py", line 1499, in ToPropertyPb
    pbvalue = pack_prop(name, v, pb.mutable_value())
  File "/sinfo/google_appengine/google/appengine/api/datastore_types.py", line 1322, in PackString
    pbvalue.set_stringvalue(unicode(value).encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not …

google-app-engine google-cloud-datastore

3
推荐指数
1
解决办法
1951
查看次数