Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encode compiled content when writing it w/o compression
As of django-compressor#312, the output of compiled content is always unicode. With ``COMPRESS_ENABLED=True``, that unicode was piped directly to compression without writing the intermediate content. The byte encoding of the compressed content is handled correctly in this case. However, with ``COMPRESS_ENABLED=False``, the unicode content was sent directly to a ``django.core.files.base.ContentFile`` instance, and somewhere in there it turned that content into 4-byte-wide characters resembling UTF-32 encoded content. This encodes that content using UTF-8 before handing it off to the ``ContentFile``. This may present an issue in a corner case where something other than UTF-8 encoding is desired. Signed-off-by: Liam Curry <liam@curry.name>
- Loading branch information