Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function URLdecode
PARAMETER pcInStr
* ' unencode EVERY %XX
* ' (keep track of current position so you don't unencode
* ' a percent that just came out of an URLencoded char
LOCAL I, tStr, tChr, tOut
tStr = pcInStr
tOut = ""
tStr = StrTran(tStr, "+", " ")
I = 1
do While I <= Len(tStr)
If (SubStr(tStr, I, 1) = "%") ;
And SubStr(tStr, I + 1, 1) $ "0123456789ABCDEF" ;
And SubStr(tStr, I + 2, 1) $ "0123456789ABCDEF"
tChr = (( At( SubStr(tStr, I + 1, 1), "0123456789ABCDEF" )-1) * 16 ) ;
+ (( At( SubStr(tStr, I + 2, 1), "0123456789ABCDEF" )-1) )
I = I + 2
*03/18/03 Zero's are now allowed.
if between(tChr,0,255) && 03/18/03
* if tChr > 0 and tChr < 255
tOut = tOut + chr( tChr )
endif
else
tOut = tOut + SubStr(tStr, I, 1)
EndIf
I = I + 1
EndDo
RETURN tOut
**********************************************************
Function URLencode
PARAMETER pcInStr
* ' encode Percent signs
* ' Double Quotes
* ' CarriageReturn / LineFeeds
LOCAL lcOut, lnI
lcOut = ''
for lnI = 1 to len(pcInStr)
lcCh = Substr(pcInStr,lnI,1)
if not between( lcCh, chr(33), chr(126) ) ;
or inlist(lcCh,[+],[%],["],[,],['],[`],[=],[ ],[&])
lcCh = '%' + PADL( int2Hex( asc(lcCh) ), 2, '0' )
endif
lcOut = lcOut + lcCh
endfor
*!* lcOut = pcInStr
*!* lcOut = StrTran(lcOut, "+", "%2B")
*!* lcOut = StrTran(lcOut, "%", "%25")
*!* lcOut = StrTran(lcOut, '"', "%22")
*!* lcOut = StrTran(lcOut, ",", "%2C")
*!* lcOut = StrTran(lcOut, Chr(13) + Chr(10), "%0D%0A" )
*!* lcOut = StrTran(lcOut, Chr(13), "%0D")
*!* lcOut = StrTran(lcOut, Chr(13), "%0A")
RETURN lcOut