Sharekit: url changed when posting to facebook?

I place the image with the image header, and I added a URL in the image header, I can also share the image and the URL, but there is a slight modification in the url.The = character is converted to% 3D, as shown below both URLs (dummy URL )

published URL: http: //....=418ioekVlhTIu2sr9qpdAQ==

Facebook URL http: //...=418ioekVlhTIu2sr9qpdAQ%3D%3D

So, is there a better way to post the URL and image in only one post or help me so that after making some change in the code, I should be able to use the correct URL in the image name itself.

+4
source share
1 answer

This is because the URL format converts the reserved special characters to HTML object codes (percentage of escaping), as shown here: http://www.w3schools.com/tags/ref_urlencode.asp

You have 2 options for correctly passing a URL string:

  • On the recipient side (after the request for the URL is sent by the client), decode the URL string you received, this normalizes the string in normal mode.

  • Use the POST method for html instead of the GET method to store your parameters. although I'm not sure that you have the opportunity to do so.

In iOS obj-c, conversion between scrolls of URLs is done like this:

[normalText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [encodedText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 

Just for fun: You can enter the URL and see its encoded / decoded value on this website: http://meyerweb.com/eric/tools/dencoder and see how it works in practice.

+1
source

All Articles