3

I have a Json return that has a string that sometimes inludes something like \Uf604 in the array (IE memo = "\Uf604";). I need to convert it to \U0001F604 if possible.

I tried to do something like stringByReplacingOccurrencesOfString but at that point when its in a string and it's been converted to ÔòÑ which I think it needs to be üòÑ to be displayed as a emoticon. I also tried

[str stringByReplacingOccurrencesOfString:@"Ô" withString:@"ü"];

But that didn't change anything. It still gets returned as ÔòÑ.

Any help would be appreciated!

Imirak
  • 1,323
  • 11
  • 21
Josh York
  • 411
  • 1
  • 5
  • 18
  • [I think this link has solution for your problem...][1] [1]: http://stackoverflow.com/questions/11365450/nsstring-with-unicode-issue-from-web-service?rq=1 – NiravPatel Sep 07 '12 at 06:04

1 Answers1

0

I believe str = [str stringByReplacingOccurrencesOfString:@"Ô" withString:@"ü"]; is what you are trying to do.

stringByReplacingOccurrencesOfString:withString: doesn't change the string you are calling on but returns a new string with replaced characters.

htinlinn
  • 856
  • 6
  • 5