Skip to content
Snippets Groups Projects
Commit d1bb616a authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fixed encoding problems. again.

parent a5ccb836
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ WHERE letzter_termin > current_date AND macher != '' AND titel NOT LIKE 'Musikpr
counter = 0
for row in cursor.fetchall():
for macher in row[0].decode('latin1').encode('utf8').split(','):
for macher in row[0].split(','):
host = Host(name=macher.strip())
host.save()
......
......@@ -26,9 +26,9 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d
counter = 0
for ntitel, datum, stitel, notiz in cursor.fetchall():
ntitel = strip_tags(ntitel.decode('latin1').encode('utf8'))
stitel = strip_tags(stitel.decode('latin1').encode('utf8'))
notiz = clean_html(notiz.decode('latin1').encode('utf8'))
ntitel = strip_tags(ntitel)
stitel = strip_tags(stitel)
notiz = clean_html(notiz)
if stitel.endswith('(Wiederholung)'):
stitel = stitel[:-15]
......
......@@ -32,7 +32,7 @@ WHERE letzter_termin > current_date AND titel NOT LIKE 'Musikprogramm' AND titel
counter = 0
for titel, beginn, ende, erster_termin, letzter_termin, rhytmus, termin in cursor.fetchall():
titel = strip_tags(titel.decode('latin1').encode('utf8'))
titel = strip_tags(titel)
hours, seconds = divmod(beginn.seconds, 3600)
minutes, seconds = divmod(seconds, 60)
......@@ -64,7 +64,7 @@ FROM sendungen
WHERE letzter_termin > current_date AND titel LIKE '%%(Wiederholung)'""")
for titel, beginn, ende, erster_termin, letzter_termin, rhytmus, termin in cursor.fetchall():
titel = titel.decode('latin1').encode('utf8')[:-15]
titel = strip_tags(titel[:-15])
hours, seconds = divmod(beginn.seconds, 3600)
minutes, seconds = divmod(seconds, 60)
......
......@@ -28,14 +28,14 @@ ORDER BY titel, beginn, ende""")
counter = 0
for titel, beschreibung, web, macher in cursor.fetchall():
titel = strip_tags(titel.decode('latin1').encode('utf8'))
beschreibung = clean_html(beschreibung.decode('latin1').encode('utf8'))
titel = strip_tags(titel)
beschreibung = clean_html(beschreibung)
slug = slugify(titel)
hosts = []
for macher in macher.decode('latin1').encode('utf8').split(','):
for macher in macher.split(','):
macher = macher.strip()
try:
host = Host.objects.get(name=macher)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment