title: Paypal IPN verification in Django
body: <p>I am having unicode problems with verifying a IPN request.</p>
  
  <p>I use the following function to verify the request.</p>
  
  <pre><code>def verify(self):
      parameters = self.params
      parameters['cmd'] = '_notify-validate'
      parameters = urllib.urlencode(dict([(k, v.encode(parameters['charset'])) for k, v in parameters.items()]) )
      return self.call_paypal(parameters) == 'VERIFIED'
  </code></pre>
  
  <p>The self.parmas is request.POST and this throws the following error:</p>
  
  <pre><code>UnicodeEncodeError: 'charmap' codec can't encode character u'\ufffd' in position 1: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>A dump of the post can be found here: <a href="http://pastebin.com/sd2iwu41" rel="nofollow">http://pastebin.com/sd2iwu41</a></p>
  
  <p>I find it weird that there is an encoding error since I am using the same encoding paypal sends me.</p>