From 9adfb550ae228971cf0804429c446925bb53a580 Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Thu, 2 Feb 2012 23:27:36 +0100 Subject: [PATCH] Fixes PDF encoding --- main/pdf.py | 3 ++- main/templates/pdf/new_temp_user.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main/pdf.py b/main/pdf.py index 88d6755..453edda 100644 --- a/main/pdf.py +++ b/main/pdf.py @@ -21,7 +21,8 @@ def render_to_pdf(template_src, context_dict, context_instance): pdf = pisa.pisaDocument( StringIO.StringIO(html.encode("UTF-8")), dest=result, - link_callback=fetch_resources) + link_callback=fetch_resources, + encoding='UTF-8') if not pdf.err: return HttpResponse(result.getvalue(), mimetype='application/pdf') return HttpResponse('We had some errors
%s
' % escape(html)) diff --git a/main/templates/pdf/new_temp_user.html b/main/templates/pdf/new_temp_user.html index 178efc5..9994456 100644 --- a/main/templates/pdf/new_temp_user.html +++ b/main/templates/pdf/new_temp_user.html @@ -45,7 +45,7 @@ Navn (SSID): dns-intern