UNICODE

Returns the Unicode code point of the first character of a string.

This function corresponds to the unicode(X) function in SQLite. It takes a string value and returns an integer representing the Unicode code point of its first character.

If the input string is empty, the function returns NULL. If the input is NULL, the result is NULL.

Example

// SELECT unicode('A') -> 65
select(UNICODE(StringLiteral("A"))).execute()

// For the Euro sign '€'
// SELECT unicode('€') -> 8364
select(UNICODE(StringLiteral("€"))).execute()

// Using a column
val firstCharCode = select(UNICODE(Users.name)).from(Users)

Return

A KQLiteColumn of type Int containing the Unicode code point, or NULL if the input is empty or NULL.

Author

MOHAMMAD AZIM ANSARI

Parameters

column

The column or string value from which to get the first character's code point.

See also