Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2"""
3@file
4@brief Some functions about diacritics
5"""
7import unicodedata
10def remove_diacritics(input_str):
11 """
12 Removes diacritics.
14 @param input_str string to clean
15 @return cleaned string
17 Example::
19 enguérand --> enguerand
20 """
21 nkfd_form = unicodedata.normalize('NFKD', input_str)
22 only_ascii = nkfd_form.encode('ASCII', 'ignore')
23 return only_ascii.decode("utf8")