def humanize_name(name, idn=False): if idn: try: name = name.canonicalize().to_unicode() except UnicodeError: name = name.canonicalize().to_text() else: name = name.canonicalize().to_text() if name == '.': return name return name.rstrip('.')
def humanize_name(name, idn=False): if idn: try: name = name.canonicalize().to_unicode() except UnicodeError: name = lb2s(name.canonicalize().to_text()) else: name = lb2s(name.canonicalize().to_text()) if name == '.': return name return name.rstrip('.')