i have a page with links gotten from rss. they are: broken link
http://news.asiaone.com/News/Latest%252BNews/Singapore/Story/A1Story20121220-390687.html
working link
http://news.asiaone.com/News/Latest%2BNews/Singapore/Story/A1Story20121220-390687.html
i realise it works by changing %252B to %2B. im using php. is there a way to detect and correct it on the run?
A URL is composed of a limited set of characters belonging to the US-ASCII character set. These characters include digits (0-9), letters(A-Z, a-z), and a few special characters ( "-" , "." , "_" , "~" ). When these characters are not used in their special role inside a URL, they must be encoded. Question mark (“?”)
URL encoding converts characters into a format that can be transmitted over the Internet. - w3Schools. So, "/" is actually a seperator, but "%2f" becomes an ordinary character that simply represents "/" character in element of your url. Follow this answer to receive notifications.
The URL has been double encoded. %25
is the escape sequence for "%", so a regular %2B
got escaped again to %252B
.
urldecode
the value, but better avoid double-encoding it to begin with if possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With