Skip to content

codepoint - Convert Unicode into numeric value

The codepoint function will convert a Unicode string value into its numeric representation.

Syntax

codepoint(string: string): number

Arguments

Name Type Required Description
string string true The unicode character to convert to a numeric value

Example - Encoding non-standard characters

Consider the following document:

{
    "emoji_value": "❤"
}

We can take the Unicode value and encode it into its numeric form, using the codepoint function.

create emoji_numeric_value from codepoint(emoji_value)
| choose emoji_numeric_value

This will result in a document that looks like this:

{
    emoji_numeric_value: 10084
}