Postgres-style ILIKE operator (with Unicode support) (#244)

Access's `LIKE` is actually case-insensitive, but to prevent breaking existing
programs that rely on mdbtools' case-sensitive behavior, introduce a new
`ILIKE` operator to perform a case-insensitive match. Use GLib's `g_utf8_casefold`
to make the comparison UTF-8 aware. A "poor man's" version is implemented
in fakeglib, which relies on `towlower`, and won't work with multi-grapheme
case transformations (e.g. German Eszett).

Fixes #233
This commit is contained in:
Evan Miller
2021-08-04 14:45:31 -04:00
committed by GitHub
parent 1b147b8d29
commit a44a8ed8ae
11 changed files with 74 additions and 20 deletions

View File

@@ -144,6 +144,7 @@ void g_printerr(const gchar *format, ...);
gint g_unichar_to_utf8(gunichar c, gchar *dst);
gchar *g_locale_to_utf8(const gchar *opsysstring, size_t len,
size_t *bytes_read, size_t *bytes_written, GError **error);
gchar *g_utf8_casefold(const gchar *str, gssize len);
gchar *g_utf8_strdown(const gchar *str, gssize len);
/* GString */