-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Feature request: unconditional URL encode (encode all chars) #207
Comments
I forgot to mention my use case for this: it's very useful for pentesting and websec work, for instance when editing a URL or constructing payloads in an attempt to exploit and/or bypass a WAF. |
Unfortunately there's just not enough mappings to go around for all the numerous variants of the various encodings. For URL encoding, you could just as easily use Fear not, though, as |
Fair enough!
And thanks for this tip, this is indeed enough for me. |
Actually, putting the following in function! UrlEncodeAll(str) abort
return substitute(iconv(a:str, 'latin1', 'utf-8'),'.','\="%".printf("%02X",char2nr(submatch(0)))','g')
endfunction
call UnimpairedMapTransform('UrlEncodeAll', '[U') Did I miss something? |
Make sure it's in your |
I checked, it is loaded. I also tried doing the Interestingly, the
Just the |
Goddammit it broke with d53b0bd. You'll have to provide the actual |
No worries, I'll just work around it for the time being. Just in case anyone needs it, this is the full snippet to make it work: function! UrlEncodeAll(str) abort
return substitute(iconv(a:str, 'latin1', 'utf-8'),'.','\="%".printf("%02X",char2nr(submatch(0)))','g')
endfunction
call UnimpairedMapTransform('UrlEncodeAll', '[U')
nmap [U <Plug>unimpaired_UrlEncodeAll
xmap [U <Plug>unimpaired_UrlEncodeAll
nmap [UU <Plug>unimpaired_line_UrlEncodeAll |
Currently, the URL encode feature (
[u
) only encodes characters which are reserved in a URL. However, I often want to percent-encode all characters.Would you consider something like this? Seems like it would fit nicely on
[U
.The text was updated successfully, but these errors were encountered: