Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decoding the string in iphone

I want to decode my string. I have used parsing and get a string from RSS feed. In a string these special characters are not allowed &,<,> in my app. In server side encoding those characters and give it to the string. So now i got the string like,

 Actual String : <Tom&Jerry>  (only these characters are not allowed in node data & < >).

 After Encoding:  %3CTom%26Jerry%3E.

But i need to display the string is

                  <Tom&Jerry>

So how can i decode the string.

Please help me out.

Thanks.

like image 434
Pugalmuni Avatar asked Jun 12 '10 10:06

Pugalmuni


People also ask

How do I decode a string?

So first, write the very first character of the encoded string and remove it from the encoded string then start adding the first character of the encoded string first to the left and then to the right of the decoded string and do this task repeatedly till the encoded string becomes empty.

How do you decode the message?

Decoding is translating the message from its sign format into meaning. It means converting a message into thoughts by translating the received stimuli into an interpreted meaning in order to understand the message communicated.


1 Answers

Use the -stringByReplacingPercentEscapesUsingEncoding: method.

[@"%3CTom%26Jerry%3E"
 stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
like image 113
kennytm Avatar answered Oct 07 '22 07:10

kennytm