1

This is my code:

template = loader.get_template('blog/post.html')

c = Context(parameterDict)

return HttpResponse(template.render(c))

I am using this to render data into a template(contained in parameterDict). The problem is that parameterDict contains certain UTF characters like ®. This is causing a problem in my template and the particular blocks with the UTF characters are not being rendered.

Will setting the HttpResponse charset=utf-8 help? If so, how do I do this?

1 Answer 1

0

Is the content of parameterDict unicode?

parameterDict = {'title':u'® by blah'}

return render_to_response('blog/post.html',
                          parameterDict,
                          context_instance=RequestContext(request))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.