is_utf8

This function determines whether the provided value is of type str and contains valid UTF-8 characters.

This function does not generate an event.

This function has a deprecated alias isutf8 which will be removed in the next minor release.

Function

is_utf8(value)

Arguments

Argument Type Description
value any (required) The value to be tested.

Return value

Returns true if the given value is of type raw and contains valid utf8, else false.

Example

This code shows some return values for is_utf8():

[
    is_utf8( 'ԉ' ),
    is_utf8( 'pi' ),
];

Return value in JSON format

[
    true,
    true
]