UnicodeDecodeError in pyton 2.7
- by user2913962
i try to write this code to process Arabic language by python
import codecs
file = codecs.open("C:\Python27\CCA_raw_utf8.txt","r","utf-8")
text= file.read()
####################################
print "\n "," --------------------------------------------"
text=text[1:]
words=text.split()
for w in words:
if w == unicode ("?????","utf-8"):
print w
but it doesn't and take error " if w == unicode ("?????","utf-8"):
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc7 in position 0: invalid continuation byte "
why program gives this result and how we can correct that??