I'm programming in [Python](http://en.wikipedia.org/wiki/Python_%28programming_language%29) and I'm obtaining information from a web page through the [`urllib2`](http://docs.python.org/library/urllib2.html) library. The problem is that that page can provide me with non-ASCII characters, like `'ñ'`, `'á'`, etc. In the very moment `urllib2` gets this character, it provokes an exception, like this:

```
File "c:\Python25\lib\httplib.py", line 711, in send
    self.sock.sendall(str) 
File "<string>", line 1, in sendall:
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 74: ordinal not in range(128)

```

I need to handle those characters. I mean, I don't want to handle the exception but to continue the program. Is there any way to, for example (I don't know if this is something stupid), use another [codec](http://en.wikipedia.org/wiki/Codec) rather than the ASCII? Because I have to work with those characters, insert them in a database, etc.