diff OrthancServer/Search/ValueConstraint.cpp @ 2331:a47d07b5b39f

Fix issue #56 (case-insensitive matching over accents)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jul 2017 17:29:18 +0200
parents a3a65de1840f
children 878b59270859
line wrap: on
line diff
--- a/OrthancServer/Search/ValueConstraint.cpp	Fri Jul 14 16:34:16 2017 +0200
+++ b/OrthancServer/Search/ValueConstraint.cpp	Fri Jul 14 17:29:18 2017 +0200
@@ -42,12 +42,15 @@
 {
   ValueConstraint::ValueConstraint(const std::string& value,
                                    bool isCaseSensitive) : 
-    value_(value),
     isCaseSensitive_(isCaseSensitive)
   {
-    if (!isCaseSensitive)
+    if (isCaseSensitive)
     {
-      Toolbox::ToUpperCase(value_);
+      value_ = value;
+    }
+    else
+    {
+      value_ = Toolbox::ToUpperCaseWithAccents(value);
     }
   }
 
@@ -66,9 +69,7 @@
     }
     else
     {
-      std::string v;
-      Toolbox::ToUpperCase(v, value);
-      return value_ == v;
+      return value_ == Toolbox::ToUpperCaseWithAccents(value);
     }
   }
 }