TinyMUX

Ord()

Functions

FUNCTION: ord(<character>)

Returns the Unicode code point value of <character>. If <character> is a grapheme cluster composed of multiple code points (such as a base letter with combining accents), the code points are returned as a space-separated list.

The argument must contain exactly one grapheme cluster (what a user perceives as a single character). ANSI color codes are stripped before evaluation.

Examples:

> say ord(A)
You say, "65"
> say ord(~)
You say, "126"
> say ord([chr(233)])
You say, "233"
> say ord([chr(101 769)])
You say, "233"

The last two examples both return 233 because chr() NFC-normalizes its output, composing e (U+0065) + combining acute (U+0301) into the precomposed é (U+00E9 = 233).

Related Topics: Softcode functions, chr(), Unicode.