Reputation:
I am posting image with image title and in the image title I have added url, I am able to share image and url also but,there is slight modification in the url.The = symbol is converted to %3D ,as shown below the both URLs(dummy url).
posted URL: http://....=418ioekVlhTIu2sr9qpdAQ==
URL on Facebook http://...=418ioekVlhTIu2sr9qpdAQ%3D%3D
So is there any better way to post url and image in one post only or help me so that by doing some change in the code I should be able to share correct url in the Image title itself.
Upvotes: 4
Views: 264
Reputation: 5015
This happens because the URL format converts it's reserved special characters to HTML entity codes (percent escaping) as shown in here: http://www.w3schools.com/tags/ref_urlencode.asp
you have 2 options to pass the URL string correctly:
On the receiver side (after the URL Request is sent by the client), decode the URL string that you received, this will normalize the string back to normal.
Use the POST method of html instead of the GET method to store your parameters. although I'm not sure you have an option for that.
On the iOS obj-c, Conversion between URL Percent escapes is done like so-
[normalText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[encodedText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
Just for fun: You can enter a URL and see it's encoded/decoded value on this website: http://meyerweb.com/eric/tools/dencoder and see how it works in practice.
Upvotes: 1