From 162750f2cec47d1249483cdb30566bc22ed2c431 Mon Sep 17 00:00:00 2001 From: ramya vasanth Date: Wed, 3 Mar 2021 12:58:30 +0530 Subject: [PATCH] [OLINGO-1515]Support non-ascii characters in OData --- .../olingo/server/core/uri/parser/search/SearchTokenizer.java | 4 +++- .../olingo/server/core/uri/parser/SearchParserTest.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java index 2afcfd048..6f7e01e70 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java @@ -167,7 +167,9 @@ public class SearchTokenizer { */ static boolean isAllowedPhrase(final char character) { // the '%' is allowed because it is assumed that it was percent encoded and is now decoded - return isQCharUnescaped(character) || character == '%'; + return isQCharUnescaped(character) + || character == '%' + || Character.isUnicodeIdentifierStart(character); } /** diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/SearchParserTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/SearchParserTest.java index 417daa44c..77e8eef94 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/SearchParserTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/parser/SearchParserTest.java @@ -81,6 +81,7 @@ public class SearchParserTest { testUri.run("ESTwoKeyNav", "$search=\"abc\""); testUri.run("ESTwoKeyNav", "$search=\"a\\\"bc\""); testUri.run("ESTwoKeyNav", "$search=%22abc%22"); + testUri.run("ESTwoKeyNav", "$search=%22a%C3%AB%22"); testUri.run("ESTwoKeyNav", "$search=%22a%5C%22bc%22"); testUri.run("ESTwoKeyNav", "$search=%22a%5C%5Cbc%22");