Function Repository Resource:

FromCharacterName

Source Notebook

Get a string character from its name

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["FromCharacterName"]["name"]

gets the character named "name".

ResourceFunction["FromCharacterName"][{"name1","name2",}]

gets a string containing the named characters.

Details and Options

ResourceFunction["FromCharacterName"][{{},{},}] will return a list or lists of strings.
ResourceFunction["FromCharacterName"] is a partial inverse for CharacterName.

Examples

Basic Examples (3) 

Get a character from its name:

In[1]:=
ResourceFunction["FromCharacterName"]["Ellipsis"]
Out[1]=
In[2]:=
ResourceFunction["FromCharacterName"]["Checkmark"]
Out[2]=
In[3]:=
ResourceFunction["FromCharacterName"]["FreakedSmiley"]
Out[3]=

Get a string from a list of character names:

In[4]:=
ResourceFunction[
 "FromCharacterName"][{"LatinSmallLetterH", "LatinSmallLetterE", "LatinSmallLetterL", "LatinSmallLetterL", "LatinSmallLetterO"}]
Out[4]=

Get a list of strings:

In[5]:=
ResourceFunction[
 "FromCharacterName"][{{"HappySmiley", "Checkmark"}, {"FreakedSmiley",
    "Times"}}]
Out[5]=

Scope (2) 

FromCharacterName will thread over lists:

In[6]:=
ResourceFunction[
 "FromCharacterName"][{{{}, {"HappySmiley", "Checkmark"}, {"FreakedSmiley", "Times"}, {{"SpaceKey", "Times", "Infinity", "Wolf", "ImaginaryI",
      "HappySmiley"}}}, {"LatinSmallLetterH", "LatinSmallLetterE", "LatinSmallLetterL", "LatinSmallLetterL", "LatinSmallLetterO"}}]
Out[6]=

An empty list will produce an empty string:

In[7]:=
ResourceFunction["FromCharacterName"][{}]
Out[7]=

Properties and Relations (1) 

FromCharacterName is a partial inverse of CharacterName:

In[8]:=
SeedRandom[1];
FromCharacterCode[RandomInteger[65535, 10]]
Out[7]=
In[9]:=
CharacterName[%]
Out[9]=
In[10]:=
ResourceFunction["FromCharacterName"][%]
Out[10]=

Possible Issues (2) 

Names are case sensitive:

In[11]:=
ResourceFunction["FromCharacterName"]["SuperScriptOne"]
Out[11]=
In[12]:=
ResourceFunction["FromCharacterName"]["SuperscriptOne"]
Out[12]=

Each list must not mix strings and lists:

In[13]:=
ResourceFunction[
 "FromCharacterName"][{"Checkmark", {"FreakedSmiley", "Times"}}]
Out[13]=
In[14]:=
ResourceFunction[
 "FromCharacterName"][{{"Checkmark"}, {"FreakedSmiley", "Times"}}]
Out[14]=
In[15]:=
ResourceFunction[
 "FromCharacterName"][{{"Checkmark", "FreakedSmiley", "Times"}}]
Out[15]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 21 February 2019

Related Resources

License Information