Availability:built-in
[ISO]char_code(?Atom,
?Code)Convert between a single character (an atom of length 1), and
its
character code (an integer denoting the corresponding
character). The predicate alternatively accepts an SWI-Prolog string of
length 1 at Atom place.
Character codes accepted by atom_codes/2, atom_chars/2
and char_code/2
must be valid Unicode code points. Lone UTF-16 surrogate code points (0xD800...0xDFFF)
are rejected with a
type_error(character_code, Code). See section
2.18.