UrlChecker
UrlChecker copied to clipboard
URL Encode/Decode Module
Describe a related problem (optional)
Could fix #358
Describe your suggested feature
Module to decode/encode URLs on demand. Probably should only be applied on the URL Parts. Useful for sharing safe URLs (encode) and getting human readable URLs (decode)
Web API reference:
Describe alternatives you've considered for your suggested feature
No response
Other details
No response
Acknowledgements
- [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
- [X] I have written a short but informative title.
- [X] I will fill out all of the requested information in this form.
The uri parts module already shows them decoded. Is that what you were asking for the decode part?
As for encoding, the pattern module can do that if you want to create a custom url, with the "encode" set to true.
The uri parts module already shows them decoded. Is that what you were asking for the decode part?
Wasn't aware of this, but no, this is not what I meant. The uri parts module displays the decoded parts but this does not apply to the original URL => copying, sharing, opening the full URL is still encoded
You want to copy the url decoded? But then it won't be a valid url... Can you provide an example? Ideally some steps of what you want to achieve. I'm sorry but I'm not following.
Btw, you can click a decoded part to replace the current url with it (you lose the rest of the url, but that's usually what you want...)
You want to copy the url decoded? But then it won't be a valid url... Can you provide an example? Ideally some steps of what you want to achieve. I'm sorry but I'm not following.
I was planning on suggesting this exact enhancement myself!
I'll give you a few examples of percent-decoding URLs containing Hebrew text. BTW, in most cases when I use this popular online URL Decoder/Encoder, the decoded URL remains a valid URL:
- https://he.wikipedia.org/wiki/%D7%90%D7%A0%D7%93%D7%A8%D7%95%D7%90%D7%99%D7%93_%28%D7%9E%D7%A2%D7%A8%D7%9B%D7%AA_%D7%94%D7%A4%D7%A2%D7%9C%D7%94%29 becomes https://he.wikipedia.org/wiki/אנדרואיד_(מערכת_הפעלה)
- https://he.wikipedia.org/wiki/%D7%A7%D7%99%D7%93%D7%95%D7%93_URL becomes https://he.wikipedia.org/wiki/קידוד_URL
Special cases where the decoded URL is not valid include those with special characters such as double-quotes in the URL, for example, this one: https://he.wikipedia.org/wiki/%D7%A7%D7%98%D7%92%D7%95%D7%A8%D7%99%D7%94%3A%D7%A0%D7%99%D7%91%D7%99%D7%9D_%D7%95%D7%91%D7%99%D7%98%D7%95%D7%99%D7%99%D7%9D_%D7%97%D7%96%22%D7%9C%D7%99%D7%99%D7%9D
In such a case, leaving just that problematic special character percent-encoded solves the problem, like this: https://he.wikipedia.org/wiki/קטגוריה:ניבים_וביטויים_חז%22ליים
I found a list of such problematic characters inside the (English) Wikipedia page on Percent-encoding:
For links within Wikipedia needing percent-encoding, see Help:URL § Fixing links with unsupported characters
This would also be useful for links posted to BlueSky as in the example below
https://go.bsky.app/redirect?u=https%3A%2F%2Fact.eff.org%2Faction%2Ftell-congress-no-to-internet-blacklists
I have a custom pattern for the pattern checker module, but the result still contains the percent encodings.
"Bsky redirect": {
"regex": "^https?:\/\/go.bsky.app\/redirect.u=",
"replacement": "",
"enabled": "true",
"automatic": "false"
},
Result:
https%3A%2F%2Fact.eff.org%2Faction%2Ftell-congress-no-to-internet-blacklists
My current work around has been to use the URL parts module and click on the parameter containing the embedded link and then subsequently opening that link. But this is two clicks too many (click "Parameters" to open drop-down, click on parameter value, click to open link).
In order not to clobber appropriately encoded values, this would have to be run on specific matches perhaps with the aid of the automation feature.
I think I implemented the "decode" parameter, it may work for this.
You can also use the cleaner module, should work almost the same.
Please check if it works! I may close this issue then (probably forgot about it when implemented)