diff --git a/compressor/templatetags/compress.py b/compressor/templatetags/compress.py
index 9c9b46b..47863ab 100644
--- a/compressor/templatetags/compress.py
+++ b/compressor/templatetags/compress.py
@@ -108,7 +108,7 @@ class CompressorMixin(object):
rendered_output = self.render_output(compressor, mode, forced=forced)
if cache_key:
cache_set(cache_key, rendered_output)
- return rendered_output
+ return rendered_output.decode('utf-8')
except Exception:
if settings.DEBUG or forced:
raise
diff --git a/compressor/tests/test_jinja2ext.py b/compressor/tests/test_jinja2ext.py
index 043dc51..9f1a0dc 100644
--- a/compressor/tests/test_jinja2ext.py
+++ b/compressor/tests/test_jinja2ext.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
@@ -123,3 +124,15 @@ class TestJinja2CompressorExtension(TestCase):
context = {'MEDIA_URL': settings.COMPRESS_URL}
out = ''
self.assertEqual(out, template.render(context))
+
+ def test_nonascii_inline_css(self):
+ org_COMPRESS_ENABLED = settings.COMPRESS_ENABLED
+ settings.COMPRESS_ENABLED = False
+ template = self.env.from_string(u'{% compress css %}'
+ u'{% endcompress %}')
+ out = u''
+ settings.COMPRESS_ENABLED = org_COMPRESS_ENABLED
+ context = {'MEDIA_URL': settings.COMPRESS_URL}
+ self.assertEqual(out, template.render(context))