def name_fixer(p):
 if isinstance(p, unicode):
  return p
 elif isinstance(p, str):
  try:
   return p.decode('utf-8')
  except:
   try:
    return p.decode(codepage)
   except:
    return p.decode('cp1252', 'replace').replace('?', '!')
 else:
  return p

def name_fixer ( p ) : if isinstance ( p , unicode ) : return p elif isinstance ( p , str ) : try : return p . decode ( 'utf-8' ) except : try : return p . decode ( codepage ) except : return p . decode ( 'cp1252' , 'replace' ) . replace ( '?' , '!' ) else : return p
return unicode name of 8bit ascii string .