Top Method Summary
Options Name Purpose
CHARACTER ConvertUtf8Bytes (raw) Converts a UTF-8 byte sequence into a character of the session code page
CHARACTER DecodeEscape (character, integer) Decodes the percent escape at the beginning of the given value as a code page 1252 character
CHARACTER DecodeURL (character) Attempts to decode a previously-encoded URL.
LONGCHAR DecodeURL (longchar) Attempts to decode a previously-encoded URL.
CHARACTER DecodeUtf8Escape (character, integer) Decodes the UTF-8 percent escape sequence at the beginning of the given value
CHARACTER DecodeUtf8Url (character) Attempts to decode a previously-encoded URL.
LONGCHAR DecodeUtf8Url (longchar) Attempts to decode a previously-encoded URL.
LOGICAL IsContinuationEscape (character) Returns if the given value is a percent escape of a UTF-8 continuation byte (%80 to %BF)
LOGICAL IsHexPair (character) Returns if the given value consists of exactly two hex digits


Method Detail
Top

CHARACTER ConvertUtf8Bytes (raw)

Purpose: Converts a UTF-8 byte sequence into a character of the
session code page
Notes: SCL-5943: The bytes are converted with CODEPAGE-CONVERT (a
four byte sequence exceeds the INTEGER range of CHR). When
the conversion fails or does not round-trip, the character
cannot be represented in session:cpinternal and a question
mark is returned

Parameters:
prBytes RAW
The UTF-8 byte sequence of a single character
Returns CHARACTER
The converted character or a question mark
Top

CHARACTER DecodeEscape (character, integer)

Purpose: Decodes the percent escape at the beginning of the given value
as a code page 1252 character
Notes: SCL-5943: A percent sign that is not followed by two hex
digits is returned literally. The character is converted into
session:cpinternal cpinternal (previously it was returned as a raw 1252
byte, an invalid character in a utf-8 session)

Parameters:
pcEscape CHARACTER
The value starting with the percent sign (up to three characters)
piLength INTEGER
OUTPUT The number of characters of the value that have been decoded
Returns CHARACTER
The decoded character
Top

CHARACTER DecodeURL (character)

Purpose: Attempts to decode a previously-encoded URL.
Notes: The escaped bytes are decoded as code page 1252 characters.
SCL-5943: A percent sign that is not followed by two hex
digits (e.g. "100%" or "50%OFF") is kept literally

Parameters:
pcURI CHARACTER
The URL to decode
Returns CHARACTER
CHARACTER A decoded URL
Top

LONGCHAR DecodeURL (longchar)

Purpose: Attempts to decode a previously-encoded URL.
Notes: The escaped bytes are decoded as code page 1252 characters.
SCL-5943: A percent sign that is not followed by two hex
digits (e.g. "100%" or "50%OFF") is kept literally

Parameters:
pcURI LONGCHAR
The URL to decode
Returns LONGCHAR
LONGCHAR A decoded URL
Top

CHARACTER DecodeUtf8Escape (character, integer)

Purpose: Decodes the UTF-8 percent escape sequence at the beginning of
the given value
Notes: SCL-5943: The lead byte determines the length of the sequence
(C and D: two bytes, E: three bytes, F: four bytes). A percent
sign that is not followed by two hex digits is returned
literally. When a lead byte is not followed by the required
continuation bytes (%80 to %BF), the escapes of the
incomplete sequence are returned literally

Parameters:
pcEscape CHARACTER
The value starting with the percent sign (up to twelve characters)
piLength INTEGER
OUTPUT The number of characters of the value that have been decoded
Returns CHARACTER
The decoded character
Top

CHARACTER DecodeUtf8Url (character)

Purpose: Attempts to decode a previously-encoded URL.
Notes: Supports multi-byte characters.
SCL-5943: A percent sign that is not followed by two hex
digits (e.g. "100%" or "50%OFF") and the escapes of an
incomplete UTF-8 multi-byte sequence (e.g. "%E4" or the
"%C3" of "%C3%41") are kept literally. A character that
cannot be represented in session:cpinternal (e.g. the euro
sign or an emoji in an ISO8859-1 session) is returned as a
question mark

Parameters:
pcURI CHARACTER
The URL to decode
Returns CHARACTER
CHARACTER A decoded URL
Top

LONGCHAR DecodeUtf8Url (longchar)

Purpose: Attempts to decode a previously-encoded URL.
Notes: Supports multi-byte characters. The result uses the utf-8
code page.
SCL-5943: A percent sign that is not followed by two hex
digits (e.g. "100%" or "50%OFF") and the escapes of an
incomplete UTF-8 multi-byte sequence (e.g. "%E4" or the
"%C3" of "%C3%41") are kept literally. A character that
cannot be represented in session:cpinternal (e.g. the euro
sign or an emoji in an ISO8859-1 session) is returned as a
question mark

Parameters:
pcURI LONGCHAR
The URL to decode
Returns LONGCHAR
LONGCHAR A decoded URL
Top

LOGICAL IsContinuationEscape (character)

Purpose: Returns if the given value is a percent escape of a UTF-8
continuation byte (%80 to %BF)
Notes: SCL-5943

Parameters:
pcEscape CHARACTER
The three character escape to test
Returns LOGICAL
Logical value indicating if the value is a continuation byte escape
Top

LOGICAL IsHexPair (character)

Purpose: Returns if the given value consists of exactly two hex digits
Notes: SCL-5943. INDEX is case-insensitive here, so lower case hex
digits are accepted as well

Parameters:
pcHex CHARACTER
The value to test
Returns LOGICAL
Logical value indicating if the value consists of two hex digits


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       10.10.2026 15:36:02