purebred-mua / hs-notmuch

Modern Haskell binding to the Notmuch mail indexer
11 stars 2 forks source link

SearchTerm: properly encode tags #9

Open frasertweedale opened 7 years ago

frasertweedale commented 7 years ago

String (or Text) is the correct type for tags (e.g. spaces are allowed) but they must be properly encoded in the query string or notmuch will interpret it as multiple subterms.

The correct encoding is to utf-8 encode, then hex-encode all non-printable characters, as well as SPACE and DOUBLEQUOTE.