Percent encoding? - 09/09/15 07:43 PM
I was making this script that tweets out certain stuff through twitter's API and it requires me to 'percent encode' a lot of crap
Now, i looked at the following webpage to check out what they mean by that and it appears to me that its just urlencoding. https://dev.twitter.com/oauth/overview/percent-encoding-parameters
The problem is, the script i use to urlencode does something different from what url encoding normally does:
For instance, if i urlencode the string "HMAC-SHA1" using the tool on the following webpage (http://meyerweb.com/eric/tools/dencoder/), the string stays the same.
but when i encode the same string using the script i usally use for urlencoding, it changes it to "HMAC%2DSHA1".
Here's the script, found it on hawkee:
Can anyone tell me a bit about the difference between these encodings and/or point me towards an existing script that encodes like the tool on the web page?
Now, i looked at the following webpage to check out what they mean by that and it appears to me that its just urlencoding. https://dev.twitter.com/oauth/overview/percent-encoding-parameters
The problem is, the script i use to urlencode does something different from what url encoding normally does:
For instance, if i urlencode the string "HMAC-SHA1" using the tool on the following webpage (http://meyerweb.com/eric/tools/dencoder/), the string stays the same.
but when i encode the same string using the script i usally use for urlencoding, it changes it to "HMAC%2DSHA1".
Here's the script, found it on hawkee:
Code:
alias urlencode { return $regsubex($$1-,/([^\d\w])/g,$+(%,$base($asc(\t),10,16))) }
Can anyone tell me a bit about the difference between these encodings and/or point me towards an existing script that encodes like the tool on the web page?