'Return akatitle in the correct charset, as specified in
the akanotes field; if akatitle doesn\'t need to be modified,
return None.'

def _changeAKAencoding(self, akanotes, akatitle):

    oti = akanotes.find('(original    ')
    if (oti == (-1)):
        return None
    ote = akanotes[(oti + 10):].find('    title)')
    if (ote != (-1)):
        cs_info = akanotes[(oti + 10):((oti + 10) + ote)].lower().split()
        for e in cs_info:
            if (e in ('script', '', 'cyrillic', 'greek')):
                continue
            if (e.startswith('iso-') and (e.find('latin') != (-1))):
                e = e[4:].replace('-', '')
            try:
                lookup(e)
                lat1 = akatitle.encode('latin_1', 'replace')
                return unicode(lat1, e, 'replace')
            except (LookupError, ValueError, TypeError):
                continue
    return None
