Strange character added when decoding with urllib
Strange character added when decoding with urllib Question: I’m trying to parse a query string like this: filename=logo.txt\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01x&filename=.hidden.txt Since it mixes bytes and text, I tried to alter it such that it will produce the desired escaped url output like so: extended = ‘filename=logo.txt\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01x&filename=.hidden.txt’ fixbytes = bytes(extended, ‘utf-8’) fixbytes = fixbytes.decode("unicode_escape") algoext = ‘?’ + …