I am working with gzip raw data that contains non-ASCII characters that I am unable to decompress and decode.
I am getting the data from Firestore through the python client and the payload looks like:
{'lastSchemaUpdateReason': 'new-app',
'lastSchemaUpdateAt': DatetimeWithNanoseconds(2023, 10, 3, 18, 2, 38, 6000, tzinfo=datetime.timezone.utc),
'schema': '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03íZÝRë6\x10~\x15\x8f§\x971´\x07\x0eC¹é\x00iJ\x18\x08\x84\x7fÎ)\x17\x8aµN\x14lÉHr\x02\x9cá%:½ï+ö\
with open('filename.gz', 'rb') as f: data = f.read(); expanded = gzip.decompress(data); print(expanded.decode()[:100])expanded[:100]to see the first 100 bytes of the result.