Re: ordinal not in range

2009-03-02 Thread Jaap van Wingerde
Stefan Behnel wrote: >> Jaap van Wingerde wrote: >> outfile = codecs.open(output, "w", "utf_8") > I guess you mixed up the case here. > Does this help? > outfile = codecs.open(output, "wb", encoding="UTF-8") According to the Python "Codec registry an base classes"

Re: ordinal not in range

2009-02-21 Thread Jaap van Wingerde
Stefan Behnel wrote: Omschrijving = Omschrijving.replace(u"priv?", u'privé') (mind the u"...") outfile = codecs.open(output, "wb", encoding="UTF-8") (mind the "wb" for 'write binary/bytes') It works now! Looks like you'd be happier with Python 3.0, BTW... Python 3 is not in De

Re: ordinal not in range

2009-02-21 Thread Stefan Behnel
Jaap van Wingerde wrote: > Stefan Behnel wrote: >> Omschrijving = Omschrijving.replace("priv?", 'privé') actually, make that Omschrijving = Omschrijving.replace(u"priv?", u'privé') (mind the u"...") > > import codecs > file = "postbank.csv" > output = "%s.eb" % file > outfile