The UnEscape procedure converts characters from a URL-encoded string containing escaped data to non-escaped data.
unescaped-string UnEscape( szEscapedText 32766A Value Varying |
If the function succeeds, the return value is the converted text from the szEscapedText parameter. The converted text will being in the CCSID character set of the server. If the function fails, no value is returned, that is the return value is an empty string, or blanks.
The procedure works by first converting all plus sign (+) symbols to blanks. Then it searches for each occurrence of a hexadecimal symbol in the %xx format. It translates that hex value to character and then using the browser and server CCSID's it converts the character value to the server CCSID. For example:
mycgi.pgm?CUSTNO=304&NAME=Bob%20Cozzi%2C%20Jr%2E
mycgi.pgm?CUSTNO=204&NAME=Bob Cozzi, Jr.