Anyone Know Unicode? Help!

Victor Subervi victorsubervi at gmail.com
Wed Jan 30 14:47:38 CET 2008


Hi;
Second post on this. Googling shows many others with same problem, but no
answers! Help! New to unicode. Got this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 29, in tagWords
  File "/usr/local/lib/python2.5/codecs.py", line 303, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9:
ordinal not in range(128)

I think the problem comes from this code snippet:

for line in sentences:
print line
tup = re.split(' ', line)
for word in tup:
for key, value in dictionary.items():
if key == word:
word = word + '::' + value
newLine.append(word)
sentences.close()
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080130/31ab479c/attachment.html>


More information about the Python-list mailing list