Skip to content
Advertisement

Tag: utf-8

Python Stream Decode Base64 to valid utf8

I’m currently working on a problem, which I just cannot seem to find the proper solution. Maybe you guys can help me, thanks! What I am trying to do Web is returning a JSON (value is encoded in valid BASE64, which was before that ùtf-8) requests.get(url, stream=True streaming from requests (chunks=1020) iter_content(chunk_size=1020, decode_unicode=False) do some chunk work (replacing everything with

Error UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte

https://github.com/affinelayer/pix2pix-tensorflow/tree/master/tools An error occurred when compiling “process.py” on the above site. Traceback (most recent call last): What is the cause of the error? Python’s version is 3.5.2. Answer Python tries to convert a byte-array (a bytes which it assumes to be a utf-8-encoded string) to a unicode string (str). This process of course is a decoding according to utf-8 rules.

Advertisement