I\'m using Python 2.5. What is going on here? What have I misunderstood? How can I fix it?
in.txt:
Stäckövérfløw
code.py>
Use codecs.open instead, it works for me.
#!/usr/bin/env python # -*- coding: utf-8 -*- print """Content-Type: text/plain; charset="UTF-8"\n""" f = codecs.open('in','r','utf8') for line in f: print line for i in line: print i, f.close()