From: Oleg Broytman Date: Tue, 20 May 2014 03:41:28 +0000 (+0400) Subject: Сообщать, что тег не найден, по-русски X-Git-Tag: v0.1~17 X-Git-Url: https://git.phdru.name/?p=phdru.name%2Fcgi-bin%2Fblog-ru%2Fsearch-tags.git;a=commitdiff_plain;h=5c8f53a810fb2d55ff9381810dd1427ed7201949 Сообщать, что тег не найден, по-русски --- diff --git a/html/response.py b/html/response.py index cee9891..071c5df 100644 --- a/html/response.py +++ b/html/response.py @@ -11,7 +11,8 @@ def response(title, body, status=None): if status: print "Status:", status sys.stdout.write(str(result.cgiHeaders())) - sys.stdout.write(str(result)) + #sys.stdout.write(str(result)) + sys.stdout.write(unicode(result).encode('latin1')) def redirect(url, parameters=None, status=None): import urllib diff --git a/search-tags.py b/search-tags.py index 8d322d1..8e047e1 100755 --- a/search-tags.py +++ b/search-tags.py @@ -1,4 +1,5 @@ #! /usr/bin/env python +# coding: koi8-r """Search tags CGI""" __author__ = "Oleg Broytman " @@ -35,7 +36,7 @@ else: redirect("/Russian/blog/tags/%s.html" % tag, status="301 Moved") sys.exit() status = "404 Tag not found" - title = "Error!" - body = "Tag does not exist!" + title = "ïÛÉÂËÁ!" + body = "ôÅÇ %s ÎÅ ÓÕÝÅÓÔ×ÕÅÔ!" % tag response(title, body, status)