Character literal

A character literal is a type of literal in programming for the representation of a single character's value within the source code of a computer program.

[2] Languages without character data types (like Python[3] or PHP[4]) will typically use strings of length 1 to serve the same purpose a character data type would fulfil.

This simplifies the implementation and basic usage of a language but also introduces new scope for programming errors.

For example, an ASCII (or extended ASCII) scheme will use a single byte of computer memory, while a UTF-8 scheme will use one or more bytes, depending on the particular character being encoded.

This may be done directly via converting an integer literal to a character, or via an escape sequence.