Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / New in Version 3.0 / Programming  /
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[ ... , " encoding "] generates a string using the specified character encoding.
  • The integer n must lie between 0 and 65535, as returned by ToCharacterCode.
  • For n between 0 and 127, ToCharacterCode returns ASCII characters.
  • For n between 129 and 255, it turns ISO Latin-1 characters.
  • For other n it returns characters specified by the standard Mathematica encoding based on Unicode.
  • InputForm[FromCharacterCode[ n ]] 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.
  • Encodings supported in FromCharacterCode[ ... , " encoding "] are listed in the notes for $CharacterEncoding.
  • See the Mathematica book: Section 2.7.7.
  • See also: ToCharacterCode, CharacterRange, $CharacterEncoding.
  • Related package: Utilities`BinaryFiles`.

    Further Examples

    The function ToCharacterCode converts strings to character codes.

    In[1]:=

    Out[1]=

    FromCharacterCode converts these codes back to strings.

    In[2]:=

    Out[2]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.