1

I'm developing a WordPress app for iPhone. I get links from feed.

The problem is links in xml is changed if it has '&' character. '&' is replaced by '&'.

For example:

http://localhost/web-wp/?feed=rss2&p=1

I can correct this problem by the simple statement below:

link = [link stringByReplacingOccurrencesOfString:@"&" withString:@"&"];

It run correctly, the result is

http://localhost/web-wp/?feed=rss2&p=1

But I want a intelligent solution same as:

link =[link stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

The above statement run incorrectly.

How can I do?

Thank you!

vietstone
  • 8,784
  • 16
  • 52
  • 79
  • Not exactly sure what you are asking here. The first statement works correctly? – danielbeard Mar 06 '12 at 07:58
  • @danielbeard Sorry for my lack about information. I've edited my questions. Please check. Thank you! – vietstone Mar 06 '12 at 10:30
  • Duplicate of http://stackoverflow.com/questions/1105169/html-character-decoding-in-objective-c-cocoa-touch And check out Michael Waterfall's solution, although check the license restrictions – Peter M Mar 06 '12 at 14:10

0 Answers0