I'm having trouble encoding accented characters in a URL using the python command line. Reducing my problem to the essential, this code:
>>> import urllib
>>> print urllib.urlencode({'foo' : raw_input('> ')})
> áéíóúñ
prints this in a mac command line:
foo=%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA%C3%B1
but the same code prints this in windows' command line:
foo=%A0%82%A1%A2%A3%A4
The mac result is correct and the characters get encoded as needed; but in windows I get a bunch of gibberish.
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.