Fri Jul 22 06:15:21 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Fix fixu8 to support Python 2.3.
Some unicode stuff has changed in Python 2.4, so this change is needed to make
fixu8 work with older versions. It's not nice, but it does the trick and it
takes only a couple of self-contained lines.
Many people reported the problem and potential fixes, this one is by Markus
Keller <markus.keller@gmx.com>.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-10-08 17:53:15.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-10-08 17:53:16.000000000 +0000
@@ -73,7 +73,11 @@
if openpos < 0:
# small optimization to avoid the conversion to utf8 and
# entering the loop
- return s.decode(config.repoencoding).encode('utf8')
+ if type(s) == unicode:
+ # workaround for python < 2.4
+ return s.encode('utf8')
+ else:
+ return s.decode(config.repoencoding).encode('utf8')
s = s.encode(config.repoencoding).decode('raw_unicode_escape')
while openpos >= 0: