Unicode Problem
Victor Subervi
victorsubervi at gmail.com
Mon Jan 28 10:21:55 EST 2008
Hi;
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/20080128/9e513b23/attachment.html>
More information about the Python-list
mailing list