I'm trying to replace this value from my text file •
Google says it is u"\u2022", but when I do this nothing prints
from unidecode import unidecode
text = open('file.txt','r+')
l=[]
for i in text.readlines():
if unidecode(u"\u2022") in i:
print "confirmed %r" % i
It prints out the lines if I go into the file and replace the values with an asterisk.
I tried putting the character into its own file
from unidecode import unidecode
import unicodedata
text = open('unicode_char.txt','r+')
for i in text:
print unidecode(i)
That serves UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Edit -
I figured it out.
point = unichr(8226)
encoded = point.encode('utf-8')
for i in text.readlines():
if encoded in i:
print i