UnicodeDecodeError:'utf8'编解码器无法解码位置23的字节0x85:无效的起始字节

时间:2023-01-06 21:20:59

We are getting the following error while trying to get value of a GET request param in appengine app. We are using Python 2.7 and webapp2. Can someone please help find the issue here.

我们在尝试获取appengine应用程序中的GET请求参数值时收到以下错误。我们使用的是Python 2.7和webapp2。有人可以帮助在这里找到问题。


Error:


Traceback (most recent call last):
  File "/base/data/home/apps/s~appname/10.002634982369462/foldername/filename.py", line 32, in get
    self.get_link()
  File "/base/data/home/apps/s~appname/10.002634982369462/foldername/filename.py", line 64, in get_link
    if not self.request.get('link'):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 175, in get
    param_value = self.get_all(argument_name)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 212, in get_all
    param_value = self.params.getall(argument_name)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webob-1.1.1/webob/multidict.py", line 327, in getall
    return map(self._decode_value, self.multi.getall(self._encode_key(key)))
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webob-1.1.1/webob/multidict.py", line 301, in _decode_value
    value = value.decode(self.encoding, self.errors)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x85 in position 23: invalid start byte

Request Data:


link=http%3A%2F%2Fprincesseblack.c%8513%2F10%2Fprincesse-black-au-cocktail-roots-magazine-n10%2F&id=335180657:1

1 个解决方案

#1


0  

The character %85 is url-decoded as an U+0085 UTF-8 control character, also known as NEL - next line. As such can not be a part of an Url.

字符%85被url解码为U + 0085 UTF-8控制字符,也称为NEL - 下一行。因此不能成为Url的一部分。

#1


0  

The character %85 is url-decoded as an U+0085 UTF-8 control character, also known as NEL - next line. As such can not be a part of an Url.

字符%85被url解码为U + 0085 UTF-8控制字符,也称为NEL - 下一行。因此不能成为Url的一部分。