def fileName2FSEnc(fn):
        '''attempt to convert a filename to utf8'''
        from reportlab.rl_config import fsEncodings
        if isUnicode(fn):
            return asBytes(fn)
        else:
            for enc in fsEncodings:
                try:
                    return fn.decode(enc).encode('utf8')
                except:
                    pass
        raise ValueError('cannot convert %r to utf8 for file path name' % fn)