-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Encode/Decode URL #905
Comments
URL encode seems not working . . . but . . . |
Oh!!! Absolutely my bad!!! I was used to finding those options in the Edit->Special menu and thought they were replaced by the (un)escape html/xml options. I saw the tools menu but evidently not carefully enough! Well, at least we found a bug! |
No, see issue #581 for the change. |
While I have my reserves regarding the difference between Decode/Encode URL and Escape/Unescape HTML which both perform their actions on selected text. I do not want to reopen that discussion. I'm glad that the functionality is present and that's good enough for me. |
The change is from issue #315, the flag for |
Based on examples from https://learn.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-urlescapew#examples, I think here are three options for URL encode:
|
OK, I took my time to read and test and the function is actually working as expected according to that document. That being said, the URL used in that document is garbage, the only way that would ever be usefull in real programming life would be if you're creating a website in a non-english language and your filenames do not adhere to any accepted naming standard whatsoever:
becomes:
No self-respecting developer will ever do something like that! (Note that the query part was not encoded, that's even worse) Most of the times I've seen (and used) URLs that need encoding is for website redirection (specially third party). For example, this is shared (cleaned up) URL taken from Facebook:
If I use URL decode, everything's great:
But if I want to reverse it, I can't. Having the pair Encode/Decode URL implies that one function is able to "Undo" whatever the other function did, and that's not the case here. |
Looks it's my failure:
|
As the function works on selected text, I think it may be easier and more practical to treat the whole selection as the string to encode rather than just an arbitrary portion of it. As per my understanding (I may be wrong), this wouldn't conflict with #315 |
JavaScript has |
Commit b623310 added menu "URL Component Encode" (for old behavior), user will need to decide which menu to use (whole URL like JavaScript CC @xelsios, @VoilierBleu, @Matteo-Nigro, @maboroshin, @VenusGirl, @tretdm for translation updates, also note that commit a263fdd added "Use &Large Toolbar" menu for matepath. |
Notepad2-mod had a feature under the "Special" menu to encode/decode URLs.
Example: "https%3A%2F%2Fwww.google.com%2Fcontacts" to "https://www.google.com/contacts" and back
I'd like that function to come back
The text was updated successfully, but these errors were encountered: