UrlEncode function now works with busybox

This commit is contained in:
deajan 2018-06-05 11:51:49 +02:00
parent dc31bfb42d
commit 166a37865e
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
#command line arguments don't take -AaqV for example #command line arguments don't take -AaqV for example
_OFUNCTIONS_VERSION=2.3.0-dev _OFUNCTIONS_VERSION=2.3.0-dev
_OFUNCTIONS_BUILD=2018060401 _OFUNCTIONS_BUILD=2018060501
#### _OFUNCTIONS_BOOTSTRAP SUBSET #### #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
#### _OFUNCTIONS_BOOTSTRAP SUBSET END #### #### _OFUNCTIONS_BOOTSTRAP SUBSET END ####
@ -1348,12 +1348,12 @@ function HumanToNumeric {
#### HumanToNumeric SUBSET END #### #### HumanToNumeric SUBSET END ####
#### UrlEncode SUBSET #### #### UrlEncode SUBSET ####
## from https://gist.github.com/cdown/1163649 ## Modified version of https://gist.github.com/cdown/1163649
function UrlEncode { function UrlEncode {
local length="${#1}" local length="${#1}"
local LANG=C local LANG=C
for (( i = 0; i < length; i++ )); do for i in $(seq 0 $((length-1))); do
local c="${1:i:1}" local c="${1:i:1}"
case $c in case $c in
[a-zA-Z0-9.~_-]) [a-zA-Z0-9.~_-])