# universal

universal can only be used together with the keyword charstring forming a single, composed keyword.

The keyword universal charstring denotes a basic string type whose distinguished values are zero, one, or more characters from ISO/IEC 10646.

- Character string values are written between double quotes (" ").
- A single universal character may be specified by its decimal code point using a conversion function..
- Another notation used for universal character strings is the quadruple form. (Cf. the keyword char)
- A double quote inside character string is represented by a pair of double quotes with no intervening space.
- The relational operators equality (==) and non-equality (!=) can be used to compare values of two character strings
- The rotate operators perform the rotate left (<@) and rotate right (@>) operations.
- The concatenation operator (&) performs a simple concatenation from left to right.
- A single character may be accessed using an array-like syntax. The leftmost character has the index zero.
- The character string may be empty.
- Predefined functions operating on universal character strings:

- unichar2oct converts an universal charstring to an octet string.
- oct2unichar converts an octet string as an universal charstring.
- unichar2char converts a single-character-length universal charstring into a charstring value.
- unichar2int converts a single-character-length universal charstring into an integer value in the range of 0 â¦ 2 147 483 647. The integer value describes the 32-bit encoding of the character.
- lengthof returns an integer value indicating the number of characters in a string.

- The length of the universal character string can be constrained using the keyword length.
- The range of the permitted characters may be specified.
- Another way to limit the permitted values of a universal character string is to list them.

Related keywords:

- char
- charstring
- int2unichar
- length
- lengthof
- unichar2char
- unichar2int
- unichar2oct
- oct2unichar

### universal charstring

Example 1:

const universal charstring c_kordo := "ĉirkaŭĵo";

The constant defined is called c_kordo and has the value ĉirkaŭĵo

Example 1a:

const universal charstring c_ukrouzek := int2unichar (367);

The constant called c_ukrouzek will contain the Czech letter ů

Example 2:

const universal charstring c_leet := "Ãªtre:""";

The constant defined is called c_leet and has the value Ãªtre:"

Example 3:

const boolean c_baade := ( c_kordo == c_leet );

The constant c_baade will have the value false, because two character strings are equal only if they have equal lengths and the characters at all positions are the same. The parantheses are optional.

Example 4:

const charstring c_gluo := c_kordo & c_ukrouzek & c_ukrouzek & c_ukrouzek;

The constant c_gluo will contain the string ĉirkaŭĵoůůů

Example 5:

const universal charstring c_circonflex := c_leet[0];

The constant called c_circonflex will contain a single element with the value Ãª.

Example 6:

const universal charstring c_vakuo := "";

The constant called c_vakuo will be an empty string.

Example 7a:

const charstring c_siffra := unichar2char(char(0,0,0,64));

The constant called c_siffra will have the charstring value "@".

Example 7b:

const integer c_siffra := unichar2int("Ã©");

The constant called c_siffra will have the integer value 130.

const integer c_siffra1 := unichar2int(char(127,255,255,255));

The constant called c_siffra will have the integer value 2 147 483 647.

Example 7c:

const integer c_longeur := lengthof(c_kordo);

The constant called c_longeur will have the value 8 corresponding to the number of characters in the string .

Example 7d:

const integer c_ostr := unichar2oct("ÃÃÃÃ¤Ã¶Ã¼");

The constant called c_ostr will have the value 'EFBBBFC384C396C39CC3A4C3B6C3BC'O.

Example 7e:

const integer c_ustr := oct2unichar('C384C396C39CC3A4C3B6C3BC'O);

The constant called c_ustr will have the value "ÃÃÃÃ¤Ã¶Ã¼"

Example 8:

var universal charstring c_een(char(0,0,0,129));

The variable called c_een may hold only the character "Ã¼".

Example 9:

const universal charstring c_merry := "Ã¡bcdÃ©fg" <@ 3;

The constant called c_merry will hold the value"dÃ©fgÃ¡bc" (the left operand rotated by three characters) .

Example 10:

var universal charstring v_spannung((char(0, 0, 0, 67) .. char(0, 0, 0, 69));

The variable v_spannung may have the following values: "c", "d", "e".

BNF definition of universal
BNF definition of universal charstring value