diff options
author | Simon Law <simon.law@ecometrica.com> | 2012-08-23 11:11:29 -0400 |
---|---|---|
committer | Simon Law <simon.law@ecometrica.com> | 2012-08-23 11:11:29 -0400 |
commit | f90cff165af1ea1ede5cf4679e44735400cd649f (patch) | |
tree | b2853c9ba18202e175d477d32c71cc530be52b1f | |
parent | fd3c890e2ecd2b5448ee7ca65503c2b31ac92ddb (diff) | |
download | django-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.tar.gz django-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.tar.bz2 django-wkhtmltopdf-f90cff165af1ea1ede5cf4679e44735400cd649f.zip |
Fix encoding issues ini PDFTemplateResponse.render_to_temporary_file()
-rw-r--r-- | wkhtmltopdf/views.py | 3 |
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, |