Thanks! Opening and saving the file with the iso-8859-1 codec seems to handle the characters correctly. Now the only problem left are the missing newlines in the output file. I tried googling for the iso code for newline and entering it in a Python string as '\x0A' but it doesn't work in the output file which still loses the newlines.
Janne Tuukkanen wrote: > Sat, 13 Oct 2007 16:13:21 +0300, Juha S. kirjoitti: > > >> Thanks for the reply. I made changes to my code according to your >> example. Now any Scandinavian characters that are outputted by the >> program are missing in the Tk text box. >> > > > >> file = codecs.open(filename, 'r', 'utf-8', 'ignore') >> > > Remove that 'ignore'. If you then get error which complains, > that utf-8 codec can't handle the file, you've found the culprit. > The file might be in iso-8859-1. > > > JanneT > > -- http://mail.python.org/mailman/listinfo/python-list