URL encoding

Value resolver – Abstract

Purpose: Replaces invalid or special characters within a transferred URL with universal characters.

images/download/attachments/177907219/image-2024-8-12_14-9-30-version-1-modificationdate-1723464569911-api-v2.png

The URL encoding resolver applies the URL encoding ('percentage encoding') to a character string passed as an input value.

  • URL encoding replaces selected characters with two-digit hexadecimal codes (00-FF), each preceded by a percent sign (%).

  • The 'encoded' character string only uses ASCII characters that can be used in the string value of a URI parameter, for example, without overlapping with syntactically relevant characters of the URI ('.', '?', '/', '&', '=', etc.).

  • Groups of up to three hex codes can also be used to encode all characters of the UTF-8 string.

Simple examples:

Input value (String)

URL encoding

Comments

Smith&Wesson

Smith%26Wesson

The ampersand (&) is coded as %26, i.e. by reference to the character with the decimal code 38 (= 2 x 16 + 6) in the ASCII character set.

Pratt & Whitney

Pratt%20%26%20Whitney

In addition to the ampersand (&), the surrounding spaces must also be 'masked' using the hex value %20 as ASCII character no. 32 (= 2 x 16).

1€=$1.09

1%E2%82%AC%3D%241.09

The equal sign (=) is coded as %3D, the dollar sign ($) as %24, the euro symbol (€) requires a code with two bytes as a UTF-8 special character: %E2%82.

Les Champs-Élysées

Les%20Champs-%C3%89lys%C3%A9es

The space appears as %20, the two accented vowels (é and É) require two bytes each as UTF-8 special characters: %C3%89 and %C3%A9.

Übergrößenänderungsschneiderei

%C3%9Cbergr%C3%B6%C3%9Fen%C3%A4nderungsschneiderei

German special characters (ä, ö, Ü and ß) are replaced by UTF-8 codes with two hex bytes each.

https://lobster-world.com/?s=API

https%3A%2F%2Flobster-world.com%2F%3Fs%3DAPI

Hier wurde eine komplette URL (inkl. Query-Parameter "s" mit einem Wert "API") enkodiert, sodass die Zeichen ":", "/", "?" und "=" durch die zugehörigen ASCII-Hex-Codes ersetzt werden.

https://lobster-world.com/?s=No%20Code

https%3A%2F%2Flobster-world.com%2F%3Fs%3DNo%2520Code

Here, the parameter value for the search already contains URL code (for the space in the search text 'No code'), so that the already encoded percent sign (%) is encoded again. Instead of the space, the character string %2520 appears, in which %25 encodes the percent sign. The double-coded URL cannot be used directly (as in the previous example). It must be decoded twice in order to obtain a target URL.


IMPORTANT◄ If the input value is not a string (String), the string image of the input value is encoded. One of the factors determining the structure of the character string used as a string image is the data type of the input value. However, a specific mapping rule can apply for each execution context (client vs. server), which may also take localizations in the Localization or Company specific localization into account. The following table illustrates these influences using two examples:

Configuration example

Execution context

Current locale

String image

URL encoding

Comments

Input value from the dynamic enumeration Company type:

images/download/attachments/177907219/image-2024-8-12_15-32-9-version-1-modificationdate-1723469528728-api-v2.png

Server
(e.g. Event handling)

irrelevant

CNE

CNE

no character 'recoded'

Client
(e.g. Client workflow)

Deutsch (DE)

Empfänger

Empf%C3%A4nger

The umlaut 'Ä' in the string image is replaced by the corresponding UTF-8 hexadecimal values (C3 and A4) in 'percentage coding'.

English (EN)

Consignee

Consignee

no character 'recoded'

The input value is a DateTimedata object, created here with a Relative date with time value resolver:


images/download/attachments/177907219/image-2024-8-12_14-44-55-version-1-modificationdate-1723466695414-api-v2.png



Server
(e.g. Event handling)

irrelevant

2023-01-01 00:00:00.000 Africa/Cairo (2022-12-31 22:00:00.000 UTC)

2023-01-01+00%3A00%3A00.000+Africa%2FCairo+%282022-12-31+22%3A00%3A00.000+UTC%29

Default formatting of the server for time information (in the original time zone and UTC with time incl. millisecond) with 'recoded' special characters (space as +, colon, slash, brackets).

Client
(e.g. Client workflow)

Deutsch (DE)

01.01.2023 00:00

01.01.2023%2000%3A00

Default date-time format of the client (localizations for the Current locale [lobsterui/dateFormat] [lobsterui/timeFormat]
with 'recoded' special characters (space as %20, colon, slash).

English (EN)

01/01/2023 12:00 AM

01%2F01%2F2023%2012%3A00%20AM