'convert filename to unicode in order to display it in Tk'

def _filename_to_unicode(self, filename):

    if (isinstance(filename, unicode) or (not filename)):
        return filename
    try:
        return filename.decode(self.filesystemencoding)
    except UnicodeDecodeError:
        try:
            return filename.decode(self.encoding)
        except UnicodeDecodeError:
            return filename.decode('iso8859-1')
