SharePoint: Search Results are not being returned when we use special characters.

We could face a problem in searching the special characters by using the GET method.

 

For example, I have a document which has the German characters in it. I have indexed the document already. In the URL type the following, and hit enter.

 

https://karthickmain:9091/Search.aspx?k=veröffentlichten

 

Now check the site context search box. It has the word “verffentlichten” missing the “ö” character. This results the invalid search result.

 

If I replace the default search box with my custom one as per the following msdn article that also results the same result

Creating a Site Context Search Box that Uses SharePoint Portal Server Search Results

https://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/odc_spssearchboxwithportalsearchresults.asp

 

This article uses the JavaScript escape function to encode the URL. But this method doesn’t encode the special characters properly. So we end up with invalid search results.

 

Solution: In the custom search box code, use the “escapeProperly” function which is defined in the ows.js file. This will encode the URL appropriately and will return the expected result.