summaryrefslogtreecommitdiff
path: root/src/entry_backend/pango.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-10-18 19:33:41 +0100
committerPhil Jones <philj56@gmail.com>2022-10-18 19:33:41 +0100
commit5482f0be746a98bdd6b2c54183b54dd2ff2a0192 (patch)
treedc58c6a1c486432f853bd3a5f9f7c78767c7292a /src/entry_backend/pango.c
parent8872f664671711b97e02fe97f31746b5e158e627 (diff)
Improve UTF-8 handling.
This should allow case-insensitive matching for non-Latin characters, and fix matching for characters with diacritics.
Diffstat (limited to 'src/entry_backend/pango.c')
-rw-r--r--src/entry_backend/pango.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/entry_backend/pango.c b/src/entry_backend/pango.c
index 1f19bce..1cc7628 100644
--- a/src/entry_backend/pango.c
+++ b/src/entry_backend/pango.c
@@ -4,6 +4,7 @@
#include "../entry.h"
#include "../log.h"
#include "../nelem.h"
+#include "../utf8.h"
#include "../xmalloc.h"
#undef MAX
@@ -181,7 +182,7 @@ void entry_backend_pango_update(struct entry *entry)
PangoRectangle ink_subrect;
PangoRectangle logical_subrect;
if (entry->input_mb_length > 0 && entry->selection_highlight_color.a != 0) {
- char *match_pos = strcasestr(str, entry->input_mb);
+ char *match_pos = utf8_strcasestr(str, entry->input_mb);
if (match_pos != NULL) {
prematch_len = (match_pos - str);
postmatch_len = strlen(str) - prematch_len - match_len;