About Combining Characters

In Unicode, characters with diacritical symbols sometimes might be stored as an ASCII letter and a diacritical symbol, for example: stored as .

To make sure that all your data is stored consistently for filtering, search, and character length checks, normalize the Unicode strings before saving them to the database:

1
2
import unicodedata
text = unicodedata.normalize("NFC", text)

Tips and Tricks Programming Python 3 Unicode