From: Torsten Werner Date: Tue, 16 Mar 2010 20:16:34 +0000 (+0000) Subject: don't convert changes file from utf-8 to ascii X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b3df5697c1f70f1202048745e6d8c2e5fb9e6cc5;p=dak.git don't convert changes file from utf-8 to ascii Signed-off-by: Torsten Werner --- diff --git a/tools/queue_rss.py b/tools/queue_rss.py index 8eb81f17..fd67d5bd 100755 --- a/tools/queue_rss.py +++ b/tools/queue_rss.py @@ -12,7 +12,6 @@ import cPickle import re import sys import time -import encodings.ascii from optparse import OptionParser from datetime import datetime @@ -53,14 +52,6 @@ class Status: self.queue = {} -def utf2ascii(src): - """ Return an ASCII encoded copy of the input UTF-8 string """ - try: - res = unicode(src, 'utf-8').encode('ascii', 'replace') - except UnicodeDecodeError: - res = None - return res - def purge_old_items(feed, max): """ Purge RSSItem from feed, no more than max. """ if feed.items is None or len(feed.items) == 0: @@ -144,8 +135,8 @@ def add_rss_item(status, msg, direction): return False description = "
Description: %s\nChanges: %s\n
" % \ - (utf2ascii(cgi.escape(msg['Description'])), - utf2ascii(cgi.escape(msg['Changes']))) + (cgi.escape(msg['Description']), + cgi.escape(msg['Changes'])) link = "http://ftp-master.debian.org/new/%s_%s.html" % \ (msg['Source'], msg['Version']) @@ -155,7 +146,7 @@ def add_rss_item(status, msg, direction): title, pubDate = pubdate, description = description, - author = utf2ascii(cgi.escape(msg['Maintainer'])), + author = cgi.escape(msg['Maintainer']), link = link, guid = link )