MIME Tools does not url encode commas?
-
I was using Notepad++ and the MIME tools plug in to encode URLs.
It seems that the MIME Tools plugin does not URL encode commas.In Notepad++
a,b => a,bHowever, in tools like www urlencoder org
a,b => a%2CbI thought commas need to be encoded per rfc3986 section 2.2.
-
Commas hold special meaning in URLs, but can be used in URLs, so to always encode the comma in a URL is just as incorrect as you think it is for Notepad++ to have not encoded them at all.
If you want to force Notepad++'s MIME Tools plugin to convert the comma, you can use the Full URL Encode command (though you’ll likely complain that it also encodes the
a
and theb
). Or after doing the URL Encode command, you can reselect the text and do a search/replace to convert,
into%2C
. -
Hello, @michael-levy, @peterjones and All,
Some other characters are not %-encoded when using the The
Plugins > MIME Tools > URL Encode
optionSo, here is a simple regex S/R which will encode the remaining
ASCII
characters !SEARCH
(!)|(\$)|(')|(\()|(\))|(\*)|(\+)|(,)|(-)|(\.)|(_)
REPLACE
(?1%21)(?2%24)(?3%27)(?4%28)(?5%29)(?6%2A)(?7%2B)(?8%2C)(?9%2D)(?10%2E)(?11%5F)
If you do NOT want to encode the
_
char, use this S/R :SEARCH
(!)|(\$)|(')|(\()|(\))|(\*)|(\+)|(,)|(-)|(\.)
REPLACE
(?1%21)(?2%24)(?3%27)(?4%28)(?5%29)(?6%2A)(?7%2B)(?8%2C)(?9%2D)(?10%2E)
Best Regards,
guy038