title: Unable to convert UTF-8 text from NSDictionary in Objective-C
body: <p>Im using <code>foursquare API</code> to get some locations around me, but when the name of that place wasn't in english, the name will be like follows:</p>
  
  <pre><code>name = "\U0645\U0633\U062c\U062f \U0627\U0644\U0633\U064a\U062f\U0629 \U0639\U0627\U0626\U0634\U0629 | Aisha Mosque";
  </code></pre>
  
  <p>i tried to convert the <code>response</code> to a UTF-8 but nothing changed.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>-(void)setUpLocations{
  
  NSURL *url = [NSURL URLWithString: @"https://api.foursquare...."];
  NSData *data = [NSData dataWithContentsOfURL:url];
  NSError *error = nil;
  NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&amp;error];
  NSLog(@"Response: %@",[[[json objectForKey:@"response"]objectForKey:@"groups"]valueForKey:@"items"]);
  }
  </code></pre>
  
  <p>And the log result is:</p>
  
  <blockquote>
  <pre><code>      contact =                     {
                  };
                  id = 51712507498ec4e8c5ae9f48;
                  likes =                     {
                      count = 0;
                      groups =                         (
                      );
                  };
                  location =                     {
                      address = Abdoun;
                      cc = JO;
                      city = Amman;
                      country = Jordan;
                      distance = 3819;
                      lat = "31.95406043797281";
                      lng = "35.88095228186612";
                  };
                  name = "\U0645\U0633\U062c\U062f \U0627\U0644\U0633\U064a\U062f\U0629 \U0639\U0627\U0626\U0634\U0629 | Aisha Mosque";
                  restricted = 1;
                  stats =                     {
                      checkinsCount = 43;
                      tipCount = 2;
                      usersCount = 23;
                  };
                  verified = 0;
              },
  </code></pre>
  </blockquote>
  
  <p>Any Suggestions ??</p>
  
  <p><strong>EDIT:</strong>
  here is how i extract the data from the dictionary:</p>
  
  <pre><code>NSDictionary *dic = [[[[json objectForKey:@"response"]objectForKey:@"groups"]valueForKey:@"items"] copy];
  
  namesArray = [[NSArray alloc]initWithArray:[self removeWhiteSpaces:[dic valueForKey:@"name"]]];
  
  -(NSArray *)removeWhiteSpaces:(NSDictionary *)dic{
  
  NSString *str = [NSString stringWithFormat:@"%@",dic];
  NSString *str2 = [str stringByReplacingOccurrencesOfString:@"\n" withString:@""];
  NSString *secondString = [str2 stringByReplacingOccurrencesOfString:@"  " withString:@""];
  NSString *thirdString = [secondString stringByReplacingOccurrencesOfString:@"(" withString:@""];
  NSString *forthString = [thirdString stringByReplacingOccurrencesOfString:@")" withString:@""];
  NSString *fifthString = [forthString stringByReplacingOccurrencesOfString:@"\"" withString:@""];
  NSArray *items = [fifthString componentsSeparatedByString:@","];
  
  
  return items;
  
  
  
  }
  </code></pre>
  
  <p>And in the <code>UITableView</code>:</p>
  
  <pre><code>cell.textLabel.text = [NSString stringWithFormat:@"Name: %@ ",[namesArray objectAtIndex:indexPath.row] ];
  </code></pre>
  
  <p><strong>Update</strong> </p>
  
  <p>After trying @Martin R answer i got the same results:</p>
  
  <pre><code>NSDictionary *dic = [[[[json objectForKey:@"response"]objectForKey:@"groups"]valueForKey:@"items"] copy];
  NSString *value =[dic valueForKey:@"name"];
  NSLog(@"%@", value);
  UILabel *lbl = [[UILabel alloc]initWithFrame:self.view.frame];
  lbl.numberOfLines = 0;
  lbl.text = [NSString stringWithFormat:@"%@",value];;
  [self.view addSubview:lbl];
  </code></pre>
  
  <p>and here is an image of the result<img src="https://i.stack.imgur.com/mvyQo.png" alt="UILabel with the result"></p>