APIChar

Char

Conversions between characters and their code points.

A Char is one Unicode scalar value, written 'x'. Neither conversion normalizes characters or interprets an encoding; Encoding converts between text and bytes.

fromCode

fromCode : Int -> Maybe CharSource

The character with this code point, or Nothing when it is not a Unicode scalar value: below zero, above U+10FFFF, or a surrogate (U+D800 to U+DFFF).

import Char

Char.fromCode 97 == Just 'a'
Char.fromCode 55296 == Nothing
Char.fromCode 1114112 == Nothing

toCode

toCode : Char -> IntSource

The character’s Unicode code point.

import Char

Char.toCode 'A' == 65
Char.toCode '二' == 20108