From 655eccfcc3cd83b52a952875e9e1c030cacaa9eb Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Fri, 8 Mar 2024 09:22:55 -0800 Subject: [PATCH] Restore the use of unidecode for in/ni operators (#212) * Restore the use of unidecode for in/ni operators * Update changelog and version --- CHANGELOG.md | 4 ++++ evaluator.cpp | 5 ++--- version.hpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a9a0f985..6296a2af7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.50.0 + +* FSL-style "in" expressions use unidecode again + # 2.49.0 * FSL-style "in" expressions now allow numeric comparisons, but they no longer use unidecode to remove diacritics. diff --git a/evaluator.cpp b/evaluator.cpp index a2d2a03a7..2aa2e726a 100644 --- a/evaluator.cpp +++ b/evaluator.cpp @@ -387,8 +387,7 @@ static int eval(std::function feature, json_obje if (f->value.array.array[2]->type == JSON_ARRAY && (strcmp(f->value.array.array[1]->value.string.string, "in") == 0 || strcmp(f->value.array.array[1]->value.string.string, "ni") == 0)) { - static std::vector no_unidecode_data; - std::string s = mvt_value_to_string(lhs, fail, no_unidecode_data); + std::string s = mvt_value_to_string(lhs, fail, unidecode_data); if (fail) { return -1; // null in anything => false } @@ -396,7 +395,7 @@ static int eval(std::function feature, json_obje bool contains = false; for (size_t i = 0; i < f->value.array.array[2]->value.array.length; i++) { fail = false; - int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, no_unidecode_data); + int cmp = compare_fsl(ff, f->value.array.array[2]->value.array.array[i], fail, unidecode_data); if (fail) { continue; // null } diff --git a/version.hpp b/version.hpp index 91a0dc18f..52ff09125 100644 --- a/version.hpp +++ b/version.hpp @@ -1,6 +1,6 @@ #ifndef VERSION_HPP #define VERSION_HPP -#define VERSION "v2.49.0" +#define VERSION "v2.50.0" #endif