User Tools

Function CHAR-NAME


  • char-name charactername

Arguments and Values


Returns a string that is the name of the character, or nil if the character has no name.

All non-graphic characters are required to have names unless they have some implementation-defined attribute which is not null. Whether or not other characters have names is implementation-dependent.

The standard characters <Newline> and <Space> have the respective names "Newline" and "Space".

The semi-standard characters <Tab>, <Page>, <Rubout>, <Linefeed>, <Return>, and <Backspace> (if they are supported by the implementation) have the respective names "Tab", "Page", "Rubout", "Linefeed", "Return", and "Backspace" (in the indicated case, even though name lookup by "#\" and by the function name-char is not case sensitive).


(char-name #\ )


(char-name #\Space)


(char-name #\Page)


(char-name #\a)

NIL or "LOWERCASE-a" or "Small-A" or "LA01"

(char-name #\A)

NIL or "UPPERCASE-A" or "Capital-A" or "LA02"

;; Even though its CHAR-NAME can vary, #\A prints as #\A (prin1-to-string (read-from-string (format nil "#\\~A" (or (char-name #\A) "A"))))


Affected By


Exceptional Situations

Should signal an error of type type-error if character is not a character.

See Also

Function NAME-CHAR, {\secref\PrintingCharacters}


Non-graphic characters having names are written by the Lisp printer as "#\"# followed by the their name; see section {\secref\PrintingCharacters}.