2

I was wondering if there is a method to decode a string that is in URL

encoded format?

this is my URL i want to decode it but i dont understand how to do this i tried multiple

ways

http://www.demii.com/demo/dooponz/admin/index.php/chat/new_message/4/1/you/2%2C7

but didn't get the right response

Please anyone can help me out of this,

how can i decode this url i dont need % sign.

Thanks

2 Answers 2

10

By using the NSString method -(NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding

Ex:

NSString *unencodedUrlString = [@"http://www.demii.com/demo/dooponz/admin/index.php/chat/new_message/4/1/you/2%2C7" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
Sign up to request clarification or add additional context in comments.

1 Comment

Has been deprecated since iOS 9
1

Here's the not deprecated method : string​By​Removing​Percent​Encoding.

NSString *unencodedUrlString = [yourString string​By​Removing​Percent​Encoding];

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.