Search code examples
iosfacebook-graph-apiencodingfacebook-ios-sdk

Facebook iOS sdk search encoding


Please help with search string encoding. Simple request like this:

https://graph.facebook.com/search?q=max&type=user

works pretty good, bud when I try to search in cyrillic:

 https://graph.facebook.com/search?q=макс&type=user

I've got null result. What encoding should I use?


Solution

  • Here is right encodings; First time i forgot replace spaces with pluses.

    searchString = [searchString stringByReplacingOccurrencesOfString:@" " withString:@"+"];
    searchString = [searchString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];