0

I have problem with my Python RegEx treatment bloc when it deals with accented Expression. When I run my 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 this result:

Titre : c'est pas gréable à Infos:
[u" c'est pas gr\xe9able \xe0"]

I need to be able to keep accented expression in the result output. Thanks for helping

  • You are just seeing two different representations of the same unicode string, one with the unicode characters and one with their utf-8 encoding. – Klaus D. Jan 17 '16 at 04:56

1 Answers1

-1

Try this :

  print unicode((m), 'utf-8').encode('utf-8')
nAviD
  • 2,784
  • 1
  • 33
  • 54