This project has moved and is read-only. For the latest updates, please go here.

Unable to search with UTF8 Chars in Search Query

Feb 1, 2015 at 11:47 PM

I am trying to search statuses with a query which contains Turkish Characters. However, I am getting unauth error. When I replace Turkish chars with latin letters ( For exp; ö to o) it works.

Sample Code:
             var dateNow = DateTime.UtcNow.Year + "-" + DateTime.UtcNow.Month + "-" + DateTime.UtcNow.AddHours(-6).Day;
            var searchTag = "#ömer -RT -instagram -source:foursquare" + " since:" + dateNow;

            var queryResults =
                (from search in context.Search
                 where search.Type == SearchType.Search &&
                       search.Query == searchTag &&
                       search.Count == 200 &&
                       search.SinceID == sinceIdLong
                 select search);
              var srch = queryResults.SingleOrDefault();

How Can I Fix this issue?

Feb 2, 2015 at 5:35 PM
Hi Mert,

The problem doesn't appear in the Turkish character encoding. By divide-and-conquer I discovered that the problem is happening in "-source:foursquare". Looking at the Search Operators, it appears that parameter should be "news source:foursquare". For some reason, the ':' isn't being encoded by HttpClient, but changing it to '%3A' eliminates the error.

Feb 2, 2015 at 5:35 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.