From 924798ddf4d0ad07dfed1a06eb8ae0f7e577cfb2 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Wed, 26 May 2021 10:41:25 -0300 Subject: [PATCH] Backport fix for #7369 - 4.0.2: build fails against re2 20220601. --- src/common/SimilarToRegex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/SimilarToRegex.cpp b/src/common/SimilarToRegex.cpp index b54fce5cd2..dfd0572574 100644 --- a/src/common/SimilarToRegex.cpp +++ b/src/common/SimilarToRegex.cpp @@ -110,7 +110,7 @@ namespace options.set_log_errors(false); options.set_dot_nl(true); options.set_case_sensitive(!(flags & COMP_FLAG_CASE_INSENSITIVE)); - options.set_utf8(!(flags & COMP_FLAG_LATIN)); + options.set_encoding(flags & COMP_FLAG_LATIN ? RE2::Options::EncodingLatin1 : RE2::Options::EncodingUTF8); re2::StringPiece sp((const char*) re2PatternStr.c_str(), re2PatternStr.length()); regexp = FB_NEW_POOL(pool) RE2(sp, options); @@ -761,7 +761,7 @@ namespace options.set_log_errors(false); options.set_dot_nl(true); options.set_case_sensitive(!(flags & COMP_FLAG_CASE_INSENSITIVE)); - options.set_utf8(!(flags & COMP_FLAG_LATIN)); + options.set_encoding(flags & COMP_FLAG_LATIN ? RE2::Options::EncodingLatin1 : RE2::Options::EncodingUTF8); re2::StringPiece sp((const char*) finalRe2Pattern.c_str(), finalRe2Pattern.length()); regexp = FB_NEW_POOL(pool) RE2(sp, options);