0

I would like to convert convert Casa_Batll%C3%B3 to Casa_Batllȯ.

NSLog(@"Converting String:%@",[@"Casa_Batll%C3%B3" stringByReplacingOccurrencesOfString:@"%c3%b3" withString:@"ȯ"]);

Using this code, i get only known latin characters or some special characters but not unknown latin characters or special characters. Actually i am getting the string from database which is already created so i don't know about those strings in this database. I have also tried using NSString+HTML.m in this MWFeedParser. But i didn't get anything. I have also seen these link1 and link2. Please help anyone to me.

Community
  • 1
  • 1
Prasad G
  • 6,702
  • 7
  • 42
  • 65
  • If you're referring to [this](http://en.wikipedia.org/wiki/Casa_Batll%C3%B3), the last character should be `ó` and not `ȯ`. They're different characters, and the correct one is fully supported in latin charsets. – Xavi López Apr 17 '13 at 07:42

1 Answers1

1

Use stringByReplacingPercentEscapesUsingEncoding:.

NSLog(@"Converting String:%@",[@"Casa_Batll%C3%B3" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);

Adjust the encoding as appropriate.

rmaddy
  • 314,917
  • 42
  • 532
  • 579