title: URL encoding/decoding with Python
body: <p>I am trying to encode and store, and decode arguments in Python and getting lost somewhere along the way. Here are my steps:</p>
  
  <p>1) I use google toolkit's <code>gtm_stringByEscapingForURLArgument</code> to convert an NSString properly for passing into HTTP arguments. </p>
  
  <p>2) On my server (python), I store these string arguments as something like <code>u'1234567890-/:;()$&amp;@".,?!\'[]{}#%^*+=_\\|~&lt;&gt;\u20ac\xa3\xa5\u2022.,?!\''</code> (note that these are the standard keys on an iphone keypad in the "123" view and the "#+=" view, the <code>\u</code> and <code>\x</code> chars in there being some monetary prefixes like pound, yen, etc)</p>
  
  <p>3) I call <code>urllib.quote(myString,'')</code> on that stored value, presumably to %-escape them for transport to the client so the client can unpercent escape them.</p>
  
  <p>The result is that I am getting an exception when I try to log the result of % escaping.  Is there some crucial step I am overlooking that needs to be applied to the stored value with the \u and \x format in order to properly convert it for sending over http?</p>
  
  <p><strong>Update</strong>: The suggestion marked as the answer below worked for me.  I am providing some updates to address the comments below to be complete, though.</p>
  
  <p>The exception I received cited an issue with <code>\u20ac</code>. I don't know if it was a problem with that specifically, rather than the fact that it was the first unicode character in the string.</p>
  
  <p>That <code>\u20ac</code> char is the unicode for the 'euro' symbol. I basically found I'd have issues with it unless I used the urllib2 <code>quote</code> method.</p>