tis 2007-05-29 klockan 09:05 +0200 skrev "Martin v. Lo"wis":
> Yes, when writing to a file, you need to define an encoding, e.g.
>
> self.file.write(data.encode("utf-8"))
>
> You can use codecs.open() instead of open(),
> so that you can just use self.file.write(data)
If I for some reason can't
tis 2007-05-29 klockan 16:08 -0300 skrev Gabriel Genellina:
> sys.stdout = filewrapper(sys.stdout, 'utf-8')
> print u"åäö \N{GREEK CAPITAL LETTER DELTA}"
> >
> > Useful if you don't want to append .encode() to everything you print out
> > that potentially can contain non-ascii letters.
>