Re: replace text in unicode string

2005-05-14 Thread John Machin
On 14 May 2005 02:23:55 -0700, "Dan Bishop" <[EMAIL PROTECTED]> wrote: >Svennglenn wrote: >> I'm having problems replacing text in a >> unicode string. >> Here's the code: >> >> # -*- coding: cp1252 -*- >> >> titel = unicode("ä", "iso-8859-1") To the OP: This is not causing the later problem, but

Re: replace text in unicode string

2005-05-14 Thread Dan Bishop
Svennglenn wrote: > I'm having problems replacing text in a > unicode string. > Here's the code: > > # -*- coding: cp1252 -*- > > titel = unicode("ä", "iso-8859-1") > print titel > print type(titel) > > titel.replace("ä", "a") > > When i run this program I get this error: > > titel.replace("ä",

replace text in unicode string

2005-05-14 Thread Svennglenn
I'm having problems replacing text in a unicode string. Here's the code: # -*- coding: cp1252 -*- titel = unicode("ä", "iso-8859-1") print titel print type(titel) titel.replace("ä", "a") When i run this program I get this error: titel.replace("ä", "a") UnicodeDecodeError: 'ascii' codec ca