aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf
diff options
context:
space:
mode:
authorSimon Law <simon.law@ecometrica.com>2012-08-23 11:11:29 -0400
committerSimon Law <simon.law@ecometrica.com>2012-08-23 11:11:29 -0400
commitf90cff165af1ea1ede5cf4679e44735400cd649f (patch)
treeb2853c9ba18202e175d477d32c71cc530be52b1f /wkhtmltopdf
parentfd3c890e2ecd2b5448ee7ca65503c2b31ac92ddb (diff)
downloaddjango-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.tar.gz
django-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.tar.bz2
django-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.zip
Fix encoding issues ini PDFTemplateResponse.render_to_temporary_file()
Diffstat (limited to 'wkhtmltopdf')
-rw-r--r--wkhtmltopdf/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wkhtmltopdf/views.py b/wkhtmltopdf/views.py
index fff98c8..741742f 100644
--- a/wkhtmltopdf/views.py
+++ b/wkhtmltopdf/views.py
@@ -7,6 +7,7 @@ import warnings
from django.conf import settings
from django.http import HttpResponse
from django.template.response import TemplateResponse
+from django.utils.encoding import smart_str
from django.views.generic import TemplateView
from .utils import (content_disposition_filename, override_settings,
@@ -86,7 +87,7 @@ class PDFTemplateResponse(TemplateResponse, PDFResponse):
# staticfiles app, for instance.
with override_settings(**self.get_override_settings()):
context = self.resolve_context(self.context_data)
- content = template.render(context)
+ content = smart_str(template.render(context))
tempfile = NamedTemporaryFile(mode=mode, bufsize=bufsize,
suffix=suffix, prefix=prefix,