I'm a little stuck here. I have this code that unescapes html elements inside text and encodes it in utf8.
import HTMLParser
def clean_text(text):
htmlparser = HTMLParser.HTMLParser()
return htmlparser.unescape(
' '.join(text.replace('\n', '').split())
).replace(';', ',').encode('utf-8').strip()
and I use mysql (God saved me from this!)
and this code works in two projects. in the first project, the code works well, no problem. In another project, the string will be saved as follows:
Die Verbindungen zwischen Dinosauriern und Vögeln immer stärker
It should be
Die Verbindungen zwischen Dinosauriern und Vögeln immer stärker
I use django 1.7 and python 2.7.9 in both projects
What am I missing? mysql collocation utf8_general_ci, and chatset - utf8. Both mysql dbs are the same in settings.
It would be a miracle to solve this problem ... I warmly hug and kiss if someone can help me debug this thing
source
share