From f28727f61e270ecbd58e52318d3895990ff66fe5 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sun, 3 Jul 2022 14:25:47 +0000 Subject: Fix the initial-prefix optimization for the REGEXP extension such that it works even if the prefix contains characters that require a 3-byte UTF8 encoding. This should fix the problem reported by [forum:/forumpost/96692f8ba5|forum post 96692f8ba5]. FossilOrigin-Name: c94595a6e15490b432f099fefbe2429fa19287f7bdc86332cba0fd1e08f65bd6 --- ext/misc/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/misc/regexp.c') diff --git a/ext/misc/regexp.c b/ext/misc/regexp.c index b626ca424..52973cc73 100644 --- a/ext/misc/regexp.c +++ b/ext/misc/regexp.c @@ -685,7 +685,7 @@ static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); pRe->zInit[j++] = 0x80 | (x&0x3f); }else if( x<=0xffff ){ - pRe->zInit[j++] = (unsigned char)(0xd0 | (x>>12)); + pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12)); pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f); pRe->zInit[j++] = 0x80 | (x&0x3f); }else{ -- cgit v1.2.3