# -*- coding: koi8-r -*-
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2006-2017 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2006-2021 PhiloSoft Design"
import sys, os
from Cheetah.Template import Template
self.accumulator += '<a'
for attrname, value in attrs:
value = cgi.escape(value, True)
+ if isinstance(value, unicode):
+ value = value.encode('koi8-r')
if attrname == 'href':
self.accumulator += ' href="%s"' % urljoin(self.base, value)
else:
item.categoryList = tags
body = bodies[(year, month, day, file)]
body = absolute_urls(body, baseURL + url_path)
+ try:
+ body.decode('utf-8')
+ except UnicodeDecodeError:
+ body = body.decode('koi8-r').encode('utf-8')
item.body = body
- item.excerpt = get_first_p(body)
+ excerpt = get_first_p(body)
+ try:
+ excerpt.decode('utf-8')
+ except UnicodeDecodeError:
+ excerpt = excerpt.decode('koi8-r').encode('utf-8')
+ item.excerpt = excerpt
namespace = {
"title": "Oleg Broytman's blog",