uncompress base64-gzipped string

Niels Egberts niels.egberts at gmail.com
Fri Jun 12 22:58:42 CEST 2009


I'm creating a game in python and I want to a level editor called
'tiled'. It ouputs a .xml file with base64-gzipped information. Then
every 4 bytes represents a number. See the following link:

http://www.mapeditor.org/wiki/Examining_the_map_format

To start I tried:
code = base64.b64decode("H4sIAAAAAAAAAO3NoREAMAgEsLedAfafE4+s6l0jolNJiif18tt/Fj8AAMC9ARtYg28AEAAA")
code = zlib.decompress(code)

But I get:
zlib.error: Error -3 while decompressing data: incorrect header check

How can I solve this?

Thanks,
Niels.



More information about the Python-list mailing list