Remove Mn chars after NFD normalization solution in Clear category for Remove Accents by macfreek
# -*- coding: utf-8 -*-
from unicodedata import normalize, category
"""remove accents from a string"""
# first decompose accented characters (NFD normalization),
# and remove the Combining Diacritical Marks (those in the Mn category).
return ''.join(ch for ch in normalize('NFD', s) if category(ch) not in ('Mn',))
May 16, 2014