I have the following issue for which i haven't get proper solution after an hour of searching.
I have a MySQL database table which has 'Long Text' column. To use less space for storing content of files in that text column the following compression approach has been used in PHP to store the content.
$compressed_content = bzcompress($content);
$db_compressed_content = addslashes($compressed_content);
The 'db_compressed_content' is stored in database using PHP itself.
Now i am in a position to utilize the database contents using Django. I was able to come up with the model class to represent the table. 'TextField' is used to represent that particular column.
Here is my exact issue, i used 'bz2.decompress()' of python to decompress and to get the text content but am getting 'UnicodeEncodeError' under django when i tried to do that.
FYI, the charset used to store content in database using PHP was 'latin-1'.