It indeed seems challenging.
It seems that reading systems normalize text for the purpose of search sort or other and platforms seem to have APIs for handing such. I haven't used any readers other than Apple Books in a while. Yet it seems to do ok with canonical equivalence and diacritic insensitive search. If an editor should behave the same way I'm not sure but as an option maybe it'd be useful?
Not really familar but does it seem this might help?
https://doc.qt.io/qtforpython-6.6/Py...aryFinder.html