USUPPLEMENTARY

USUPPLEMENTARY returns a FIXED BIN(31) value that is either the index of the first of the UTF surrogate pair in a string or zero if the string contains no UTF surrogate pairs.

Read syntax diagramSkip visual syntax diagram
>>-USUPPLEMENTARY(x)-------------------------------------------><

x
Expression which must have CHARACTER or WIDECHAR type.

If x has CHARACTER type, then the string must contain valid UTF-8 data. However, the validity of the data will not be checked. If the data is invalid, the ERROR condition will not be raised, the program is in error, and the result returned by this function will be unpredictable.

If x has WIDECHAR type, then the string must contain valid UTF-16 data. However, the validity of the data will not be checked. If the data is invalid, the ERROR condition will not be raised, the program is in error, and the result returned by this function will be unpredictable.

As an example, the musical G-clef is represented by the UTF-16 surrogate pair 'D834_DD1E'wx, and hence in the following code, the value 3 will be listed:
    dcl w  wchar(20) varying;
    dcl jx fixed bin;

    w = '0020_0020_D834_DD1E'wx

    jx = usupplementary(w);

    put skip list(jx);





Published: 23 December 2018