Spanish Accents

Stan Iverson iversonstan at gmail.com
Thu Dec 22 18:14:56 EST 2011


On Thu, Dec 22, 2011 at 2:17 PM, Peter Otten <__peter__ at web.de> wrote:

> You are now one step further, you have successfully* decoded the file.
> The remaining step is to encode the resulting unicode lines back into
> bytes.
> The encoding implicitly used by the print statement is sys.stdout.encoding
> which is either "ascii" or None in your case. Try to encode explicitly to
> UTF-8 with
>
> f = codecs.open(p + "2.txt", "r", "iso-8859-1")
> for line in f:
>    print line.encode("utf-8")
>
>
> OOEEE! Thanks!
Stan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111222/6ae6b609/attachment-0001.html>


More information about the Python-list mailing list