Commit 696b6bc6 authored by Nelson Benítez León's avatar Nelson Benítez León

pdf backend: Ignore diacritics when searching text

Ignore diacritics (accents, umlauts, diaeresis, etc.)
when searching in case insensitive mode (default mode), as
that would broaden the search giving more expected results.

Relevant flag was added in Poppler 0.73 and was implemented
in https://gitlab.freedesktop.org/poppler/poppler/issues/637

Issue #58
parent bc7647d6
......@@ -1960,6 +1960,11 @@ pdf_document_find_find_text_with_options (EvDocumentFind *document_find,
if (options & EV_FIND_CASE_SENSITIVE)
find_flags |= POPPLER_FIND_CASE_SENSITIVE;
#if POPPLER_CHECK_VERSION(0, 73, 0)
else /* When search is not case sensitive, do also ignore diacritics
to broaden our search in order to match on more expected results */
find_flags |= POPPLER_FIND_IGNORE_DIACRITICS;
#endif
if (options & EV_FIND_WHOLE_WORDS_ONLY)
find_flags |= POPPLER_FIND_WHOLE_WORDS_ONLY;
matches = poppler_page_find_text_with_options (poppler_page, text, (PopplerFindFlags)find_flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment