Python regex and accented Expression -
this question has answer here:
i have problem python regex treatment bloc when deals accented expression. when run code:
import re title = ur"titre : c'est pas gréable à infos:" print title m = re.findall(":(.+?) infos",title , re.unicode) print unicode((m)) i have result:
titre : c'est pas gréable à infos: [u" c'est pas gr\xe9able \xe0"] i need able keep accented expression in result output. helping
try :
print unicode((m), 'utf-8').encode('utf-8')
Comments
Post a Comment