useful for creating cgi strings
Code:
'------------------------------------------------------------------------------ ' EncodeCGI encodes string characters to special characters for a CGI string. ' (the reverse of function DecodeCGI found in pbcgi.inc) ' FUNCTION EncodeCGI(s AS STRING) AS STRING LOCAL i AS LONG LOCAL temp AS STRING temp=s ' first replace the % REPLACE "%" WITH "%25" IN temp ' replace everything else FOR i = 32 TO 47 IF i <> 37 THEN ' % REPLACE CHR$(i) WITH "%"+HEX$(i) IN temp END IF NEXT FOR i = 58 TO 64 REPLACE CHR$(i) WITH "%"+HEX$(i) IN temp NEXT FOR i = 94 TO 96 REPLACE CHR$(i) WITH "%"+HEX$(i) IN temp NEXT FOR i = 123 TO 126 REPLACE CHR$(i) WITH "%"+HEX$(i) IN temp NEXT FUNCTION= temp END FUNCTION