Re: Problem reading file with umlauts

2009-07-09 Thread Claus Hausberger
Thanks a lot. I will try that on the weekend. Claus > Claus Hausberger wrote: > > Thanks a lot. Now I am one step further but I get another strange error: > > > > Traceback (most recent call last): > > File "./read.py", line 12, in > > of.write(text) > > UnicodeEncodeError: 'ascii' codec

Re: Problem reading file with umlauts

2009-07-07 Thread MRAB
Claus Hausberger wrote: Thanks a lot. Now I am one step further but I get another strange error: Traceback (most recent call last): File "./read.py", line 12, in of.write(text) UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128) ac

Re: Problem reading file with umlauts

2009-07-07 Thread Claus Hausberger
Thanks a lot. Now I am one step further but I get another strange error: Traceback (most recent call last): File "./read.py", line 12, in of.write(text) UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128) according to google ufeff ha

Re: Problem reading file with umlauts

2009-07-07 Thread Stefan Behnel
Michiel Overtoom schrob: > Viele Röhre. Macht spaß! Tsüsch! LOL! :) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem reading file with umlauts

2009-07-07 Thread Michiel Overtoom
Claus Hausberger wrote: I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change that as I do not create those files myself. I have to read those files and convert the umlauts like ö to stuff like &oumol; as the text files should become html files. umlaut-in.txt: This fi

Re: Problem reading file with umlauts

2009-07-07 Thread Stefan Behnel
Claus Hausberger wrote: > Hello > > I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change > that as I do not create those files myself. > > I have to read those files and convert the umlauts like ö to stuff like > &oumol; as the text files should become html files. > > I h

Problem reading file with umlauts

2009-07-07 Thread Claus Hausberger
Hello I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change that as I do not create those files myself. I have to read those files and convert the umlauts like ö to stuff like &oumol; as the text files should become html files. I have this code: #!/usr/bin/python # -*- c