For anyone who may be interested: The encoding function expects just one argument, source, the first one is the usual 'self' of Python. The url-dependent encoding can be done as follows:
Code:
def encoding(self, source):
if source.newurl.find('blog.aktualne') >= 0:
enc = 'utf-8'
else:
enc = 'iso-8859-2'
self.log.debug('Called encoding ' + enc + " " + str(source.newurl))
return source.decode(enc, 'replace')