Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Remove Mn chars after NFD normalization solution in Clear category for Remove Accents by macfreek
#!/usr/bin/env python3.3
# -*- coding: utf-8 -*-
from unicodedata import normalize, category
def checkio(s):
"""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