title: Problem encoding accented characters with python
body: <p>I'm having trouble encoding accented characters in a URL using the python command line. Reducing my problem to the essential, this code:</p>
  
  <pre><code>&gt;&gt;&gt; import urllib
  &gt;&gt;&gt; print urllib.urlencode({'foo' : raw_input('&gt; ')})
  &gt; áéíóúñ
  </code></pre>
  
  <p>prints this in a mac command line:</p>
  
  <pre><code>foo=%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1
  </code></pre>
  
  <p>but the same code prints this in windows' command line:</p>
  
  <pre><code>foo=%A0%82%A1%A2%A3%A4
  </code></pre>
  
  <p>The mac result is correct and the characters get encoded as needed; but in windows I get a bunch of gibberish.</p>
  
  <p>I'm guessing the problem lies in the way windows encodes characters, but I haven't been able to find a solution; I'd be very grateful if you could help me. Thanks in advance!</p>