util.Strings.urlDecode

Converts the URL-encoded string to a string in the current application locale.

Syntax

util.Strings.urlDecode(
  source STRING
 )
  RETURNING result STRING
  1. source is the URL-encoded source string (UTF-8 bytes).
  2. result is the resulting Base64 encoded string.

Usage

The util.Strings.urlDecode() method converts the URL-encoded string passed as parameter to a character string.

The source string must contain ASCII characters and/or %xx hexadecimal representation of UTF-8 encoding bytes.

The decoder is error tolerant:
  • Alphabetical characters of a %xx element can be uppercase or lowercase (%b2 = %B2).
  • If the source string contains a set of %xx elements that represent a UTF-8 encoded character which is not existing in the current application locale, it will be converted to a ? question mark.
  • If the percent character is not followed by two hexadecimal digits, then a "%" is copied to the result string and the decoder continues at the next character.

Example

IMPORT util
MAIN
    DISPLAY util.Strings.urlDecode("abc%C3%84%E2%82%AC")
END MAIN

Output:
abcĀ