views:

53

answers:

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?

A: 

Is the content of parameterDict unicode?

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

return render_to_response('blog/post.html',
                          parameterDict,
                          context_instance=RequestContext(request))
maersu