This is just a quick reply (sorry, out of time to reply in detail). You are indeed not doing this quite right. Search the PCRE2 documents for
PCRE2_MATCH_INVALID_UTF This option forces PCRE2_UTF and also enables support for matching by pcre2_match() in subject strings that contain invalid UTF sequences. Regards, Philip -- ## List details at https://lists.exim.org/mailman/listinfo/pcre-dev