VerifyUtf Method (RUNTIME)
10.4
The VerifyUtf method ensures that PL/B character data is a valid UTF-8 string. The method uses the following format:
|
|
|
|
|
|
|
|
Where:
Optional. A Program Execution Label.
Required. A RUNTIME object that has been previously declared.
Optional. A Numeric Variable that returns the result for this method.
Required. A Character String Variable or literal that contains data to be verified.
Optional. A Numeric variable or decimal number that identifies the result type to be returned.
Optional. A Numeric variable or decimal number that specifies the number of characters in the string data to be verified. When the length parameter is not used, the method determines the number of characters in the string to be tested.
Flags Affected: EOS, OVER, ZERO
Note the following:
The ZERO flag state is set to be TRUE if the {return} value is zero.
The OVER flag is set if the {return} numeric variable is too small to receive the full numeric result value.
The EOS flag is always cleared.
The {flags} bit mask values are described as follows:
|
Value |
Description |
|
0 |
This is the default value if the flags parameter is not specified for the method. When the flags value is zero, this method verifies that the data character string is a valid UTF-8 string. In this case, the return value of zero indicates that the character string is a valid UTF-8. A return of a non-zero value indicates an invalid UTF-8 string is found. |
|
1 |
When this bit value is specified, this method evaluates the logical length of the string data. In the case, the return value is the evaluated logical length of the string data. |
|
2 |
When this bit value is specified, this method evaluates the physical length of the string data. In this case, the return value is evaluated physical length of the string data. The physical length is calculated as the number of UTF-8 characters times 4. |
Examples:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See Also: RUNTIME, RUNTIME Methods, Method Syntax
![]() |