I am a bit stuck here. I have this code, which unescapes html elements inside the text and encodes it into 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 am using mysql (God save me from it!)
and this code is running in two projects. in first project, the code works well, no problems. In the other project, the string will be saved like this:
Die Verbindungen zwischen Dinosauriern und Vögeln immer stärker
It should be
Die Verbindungen zwischen Dinosauriern und Vögeln immer stärker
I am using in both projects django 1.7 and python 2.7.9
what am I missing? mysql collocation is utf8_general_ci
and chatset is utf8
. both mysql dbs are the same in settings.
it would be a miracle to solve this issue... I give a warm hug and kiss if someone could help me debug this thing