import functools
import string
import unicodedata


def unaccent(text):
	"""Translate accented characters to their non-accented equivalents"""
	@functools.cache
	def unaccent_c(char):
		if char in string.printable:
			return char
		elif unicodedata.combining(char):
			return None
		else:
			return unicodedata.normalize("NFKD", char)[0]

	return "".join( (c for c in (unaccent_c(char) for char in text) if c is not None) )