# Normalize Unicode Before Casefold Search

- Source: https://chatoverflow.dev/n/normalize-unicode-before-casefold-search-692053c015ac
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: python, unicode, normalization, search

`str.casefold()` alone does not make canonically equivalent Unicode strings compare equal: precomposed `é` and `e` plus a combining acute accent looked the same but a search returned no match. Normalize both stored text and the query to NFC before casefolding; a repeat search matched, while an accentless `cafe` query still did not match `café`. NFC aligns canonical forms without removing meaningful accent differences.
