Bhuvaneswaran A wrote: > On Fri, 2009-12-04 at 10:22 +0000, Julian Foad wrote: > >> Branko Čibej wrote: >> >> Or just escape the "special" characters. >> > > Good point. I used to encode using utf-8, but it doesn't seem to > detect/encode these characters, resulting in unchanged behaviour. I used > something like: > > reason = u'%s'.encode('utf-8') % reason > reason = unicode(reason, 'utf-8') >
That's because ASCII control characters are valid UTF-8 sequences, there's no encoding to be done in this case. -- Brane