If I have a text file that's ~1M chars & there happens to be 4 or 5 unicode chars.... is there a quick way to find & replace them without trying to convert the whole thing?
I don't care what they are converted to... could be '_' for all I care. If there's a way to convert to a similar char, that would be great, but not necessary.
If it matters, I'm trying to get around this problem:
Code:
File "/usr/lib/python2.5/smtplib.py", line 493, in data
self.send(q)
File "/usr/lib/python2.5/smtplib.py", line 320, in send
self.sock.sendall(str)
File "<string>", line 1, in sendall
UnicodeEncodeError: 'ascii' codec can't encode character u'\uf029' in position 42061: ordinal not in range(128)