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

@@ -50,7 +50,7 @@ SQL LANGUAGE
limit clause: LIMIT <integer>
operator: =, =>, =<, <>, like, <, >
operator: =, =>, =<, <>, like, ilike, <, >
literal: integers, floating point numbers, or string literal in single quotes
@@ -63,6 +63,10 @@ NOTES
The -i command can be passed the string 'stdin' to test entering text as if using a pipe.
The 'like' operator performs a case-sensitive pattern match, with ANSI-style wildcards. An underscore in the pattern will match any single character, and a percent sign will match any run of characters.
The 'ilike' operator is similar, but performs a case-insensitive pattern match.
ENVIRONMENT
LC_COLLATE Defines the locale for string-comparison operations. See locale(1).
MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1).