Zlib in database - Django

ArouroCounk

New Member
When I try to put a zlibbed string in models.TextField\[code\]>>> f = VCFile(head = 'blahblah'.encode('zlib'))>>> f.save()\[/code\]it fails:\[code\] ...raise DjangoUnicodeDecodeError(s, *e.args)DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: unexpected code byte. You passed in 'x\x9cK\xcaI\xccH\x02b\x00\x0eP\x03/' (<type 'str'>)\[/code\]Is there any way to fix this (apart from escaping the string - it has to be space-efficent)?
 
Top