Re: Unicode in writing to a file

2009-04-23 Thread Carbon Man
Thanks yes that did it. "Peter Otten" <__pete...@web.de> wrote in message news:gspmrf$qlq$0...@news.t-online.com... > Carbon Man wrote: > >> Py 2.5 >> Trying to write a string to a file. >> self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) >> cValue contains a unicode character. no

Re: Unicode in writing to a file

2009-04-23 Thread Peter Otten
Carbon Man wrote: > Py 2.5 > Trying to write a string to a file. > self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) > cValue contains a unicode character. node.tagName is also a unicode string > though it has no special characters in it. > Getting the error: > UnicodeEncodeError: '

Re: Unicode in writing to a file

2009-04-23 Thread Ulrich Eckhardt
Carbon Man wrote: > self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) > cValue contains a unicode character. node.tagName is also a unicode string > though it has no special characters in it. > Getting the error: > UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in >

Re: Unicode in writing to a file

2009-04-23 Thread Diez B. Roggisch
Carbon Man wrote: > Py 2.5 > Trying to write a string to a file. > self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) > cValue contains a unicode character. node.tagName is also a unicode string > though it has no special characters in it. > Getting the error: > UnicodeEncodeError: '

Re: Unicode in writing to a file

2009-04-23 Thread Marco Mariani
Carbon Man wrote: Py 2.5 Trying to write a string to a file. self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) cValue contains a unicode character. node.tagName is also a unicode string though it has no special characters in it. So what's the encoding of your file? If you didn

Unicode in writing to a file

2009-04-23 Thread Carbon Man
Py 2.5 Trying to write a string to a file. self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) cValue contains a unicode character. node.tagName is also a unicode string though it has no special characters in it. Getting the error: UnicodeEncodeError: 'ascii' codec can't encode charac