Can we decode URL with Notepad++?
Asked Answered
G

2

70

I am currently using this site http://ostermiller.org/calc/encode.html to decode code like.

http%3A%2F%2Fh.mysite.com%2F007%2FYRM-CD-9 to http://h.mysite.com/007/YRM-CD-9 by using URL Decode on that decoding site.

I was wondering if this can be done via Notepad++.

Gooey answered 2/7, 2013 at 16:11 Comment(3)
A workaround solution hereGrote
Thanks, I will need to read on how to install it.Gooey
TextFX only provides Convert/Encode URI componentBaroja
G
24

Thanks to PiLHA.

  1. Download the jN plugin.
  2. Place files from Zip to Plugin folder of Notepad++ in C:\Programs Files\Notepad++\plugins.
  3. Save Code below as URLENDECODE.js and save it to C:\Program Files\Notepad++\plugins\jN\includes.
  4. Restart Notepad++.

Code:

var URLDecoderEncoder = Editor.addMenu('URL-Encoding/Decoding');
URLDecoderEncoder.addItem({
    text: 'Encode',
    cmd: function() {
        var unencoded = Editor.currentView.text;
        var encoded = encodeURIComponent(unencoded);
        Editor.currentView.text = encoded;
    }
});
URLDecoderEncoder.addItem({
    text: 'Decode',
    cmd: function() {
        var encoded = Editor.currentView.text;
        var unencoded = decodeURIComponent(encoded);
        Editor.currentView.text = unencoded;
    }
});
URLDecoderEncoder.addItem({
    text: 'Decode multi-pass (7x)',
    cmd: function() {
        var encoded = Editor.currentView.text;
        var unencoded_pass1 = decodeURIComponent(encoded);
        var unencoded_pass2 = decodeURIComponent(unencoded_pass1);
        var unencoded_pass3 = decodeURIComponent(unencoded_pass2);
        var unencoded_pass4 = decodeURIComponent(unencoded_pass3);
        var unencoded_pass5 = decodeURIComponent(unencoded_pass4);
        var unencoded_pass6 = decodeURIComponent(unencoded_pass5);
        var unencoded = decodeURIComponent(unencoded_pass6);
        Editor.currentView.text = unencoded;
    }
});
Gooey answered 2/7, 2013 at 17:26 Comment(6)
Yes, Thanks. Only thing It won't record Macros. Thanks again.Gooey
Just a heads up, the JN plugin will add lots of new menu items, so if you don't like that you might want to avoid it or customize JN.Photocopier
This JN plugin is a great tool! Thanks! Are you familiar with some other nice scripts to add to the JN? Where and where can i find them?Obel
By the way, to remove all unneeded menus you can move the scripts to 'disabled' folder ('plugins\jN\includes\disabled')Obel
And another issue with the plugin is that it causes a very annoying error everytime I open or switch to a .ps1 document (powershell).Photocopier
This answer is a bit Overkill. See the answer from Jason69 for the built-in solution if you don't need the extra functionality and menu items that jN addsHydrodynamic
L
147

In Notepad++ under Plugins => MIME Tools you will find URL Encode and URL Decode.

Labourer answered 13/11, 2014 at 20:48 Comment(5)
I knew I'd seen that somewhere.Padova
Plus sign doesn't get converted to space it seems when you do URL decode through MIME tools plugin.Himyarite
It has been expired. No support for version 7Employ
It's there in version 7.3.3. Not sure if it came bundled with installer or I installed separately.Picoline
It's bundled in 7.5.3.Kelley
G
24

Thanks to PiLHA.

  1. Download the jN plugin.
  2. Place files from Zip to Plugin folder of Notepad++ in C:\Programs Files\Notepad++\plugins.
  3. Save Code below as URLENDECODE.js and save it to C:\Program Files\Notepad++\plugins\jN\includes.
  4. Restart Notepad++.

Code:

var URLDecoderEncoder = Editor.addMenu('URL-Encoding/Decoding');
URLDecoderEncoder.addItem({
    text: 'Encode',
    cmd: function() {
        var unencoded = Editor.currentView.text;
        var encoded = encodeURIComponent(unencoded);
        Editor.currentView.text = encoded;
    }
});
URLDecoderEncoder.addItem({
    text: 'Decode',
    cmd: function() {
        var encoded = Editor.currentView.text;
        var unencoded = decodeURIComponent(encoded);
        Editor.currentView.text = unencoded;
    }
});
URLDecoderEncoder.addItem({
    text: 'Decode multi-pass (7x)',
    cmd: function() {
        var encoded = Editor.currentView.text;
        var unencoded_pass1 = decodeURIComponent(encoded);
        var unencoded_pass2 = decodeURIComponent(unencoded_pass1);
        var unencoded_pass3 = decodeURIComponent(unencoded_pass2);
        var unencoded_pass4 = decodeURIComponent(unencoded_pass3);
        var unencoded_pass5 = decodeURIComponent(unencoded_pass4);
        var unencoded_pass6 = decodeURIComponent(unencoded_pass5);
        var unencoded = decodeURIComponent(unencoded_pass6);
        Editor.currentView.text = unencoded;
    }
});
Gooey answered 2/7, 2013 at 17:26 Comment(6)
Yes, Thanks. Only thing It won't record Macros. Thanks again.Gooey
Just a heads up, the JN plugin will add lots of new menu items, so if you don't like that you might want to avoid it or customize JN.Photocopier
This JN plugin is a great tool! Thanks! Are you familiar with some other nice scripts to add to the JN? Where and where can i find them?Obel
By the way, to remove all unneeded menus you can move the scripts to 'disabled' folder ('plugins\jN\includes\disabled')Obel
And another issue with the plugin is that it causes a very annoying error everytime I open or switch to a .ps1 document (powershell).Photocopier
This answer is a bit Overkill. See the answer from Jason69 for the built-in solution if you don't need the extra functionality and menu items that jN addsHydrodynamic

© 2022 - 2024 — McMap. All rights reserved.