0

What is the best way to decode a url string in perl?

Example:

input:

http://jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=Project%3D%22GLD%22+AND+fixVersion%3D%22GOLD_2%22+AND+resolution+in+%28%22Fixed%22%2C%22Engineering+Qualified+%28QA+not+required%29%22%29AND%28%28resolved%3E%3D%222015%2F08%2F25+14%3A25%22+AND+resolved%3C%3D%222015%2F09%2F07+17%3A50%22%29OR%28%22Fix+in+Build+%23%22%7E%22Gold_2.2-1%22%29%29+ORDER+BY+resolved+DESC

output:

http://jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=Project="GLD" AND fixVersion="GOLD_2" AND resolution in ("Fixed","Engineering Qualified (QA not required)")AND((resolved>="2015/08/25 14:25" AND resolved<="2015/09/07 17:50")OR("Fix in Build #"~"Gold_2.2-1")) ORDER BY resolved DESC
Omer Dagan
  • 14,868
  • 16
  • 44
  • 60
  • Is that what you really want, or do you just want to get the base URL together with the decoded parameters? – plusplus Sep 17 '15 at 08:39
  • It's not a duplicate question! There isa difference between URI PCT encoding and the URL PCT encoding! The community can learn the difference by reading the article [Percent encoding](https://en.wikipedia.org/wiki/Percent-encoding) on Wikipedia, especially the section about `application/x-www-form-urlencoded`. – chansen Sep 17 '15 at 08:44
  • 1
    also the URL is encoded twice - the query values are URI-encoded (percent encoded), but the string has been HMTL (or XML) encoded (the ampersand is &) – plusplus Sep 17 '15 at 08:44
  • 1
    @omer-dagan, [URL::Encode](https://metacpan.org/pod/URL::Encode) provides functions for encoding and decoding of [application/x-www-form-urlencoded](https://en.wikipedia.org/wiki/Percent-encoding#The_application.2Fx-www-form-urlencoded_type) encoding. – chansen Sep 17 '15 at 08:45

0 Answers0