This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

FromCharacterCode

FromCharacterCode[n]
gives a string consisting of the character with integer code n.
FromCharacterCode
gives a string consisting of the sequence of characters with codes .
FromCharacterCode
gives a list of strings.
FromCharacterCode
uses the specified character encoding.
  • The integer n must lie between 0 and 65535, as returned by ToCharacterCode.
  • For n between 129 and 255, it returns ISO Latin-1 characters.
  • For other n it returns characters specified by the standard Mathematica encoding based on Unicode.
  • InputForm gives the full name assigned to a special character with character code n.
  • Whether a particular character generated by FromCharacterCode can be rendered on your output device will depend on what fonts and drivers you are using.
Give a string consisting of the sequence of characters with codes 97, 98, and 99:
Obtain character codes:
FromCharacterCode reconstructs the original string:
A list of strings will produce a list of encoding lists:
FromCharacterCode reproduces the list of strings:
All printable ASCII characters:
Some ISO Latin-1 letters:
Give a string consisting of the sequence of characters with codes 97, 98, and 99:
In[1]:=
Click for copyable input
Out[1]=
 
Obtain character codes:
In[1]:=
Click for copyable input
Out[1]=
FromCharacterCode reconstructs the original string:
In[2]:=
Click for copyable input
Out[2]=
 
A list of strings will produce a list of encoding lists:
In[1]:=
Click for copyable input
Out[1]=
FromCharacterCode reproduces the list of strings:
In[2]:=
Click for copyable input
Out[2]=
 
All printable ASCII characters:
In[1]:=
Click for copyable input
Out[1]=
Some ISO Latin-1 letters:
In[2]:=
Click for copyable input
Out[2]=
Give a string consisting of a character:
A string consisting of a sequence of characters:
A list of strings:
Use a character encoding:
All the names of special characters that begin with "N":
Use ToCharacterCode to get character codes:
Use FullForm to get the full name assigned to a special character:
New in 2 | Last modified in 4