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


int MLGetUTF16Symbol(MLINK link, const unsigned short **s, int *n, int *c)
gets a UTF-16 character string corresponding to the name of a symbol from the MathLink connection specified by link, storing the string in s, the length in n, and the number of characters in c.
  • MLGetUTF16Symbol() allocates memory for the character string. You must call MLReleaseUTF16Symbol() to disown this memory. If MLGetUTF16Symbol() fails and the function's return value indicates an error, do not call MLReleaseUTF16Symbol() on the contents of s.
  • MLGetUTF16Symbol() returns immutable data.
  • MLGetUTF16Symbol() stores all characters directly in the UTF-16 Unicode encoding form.
  • MLGetUTF16Symbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLGetUTF16Symbol() fails.
  • MLGetUTF16Symbol() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* read a UTF-16 symbol from a link */

void f(MLINK lp)
    const unsigned short *symbol;
    int length;
    int characters;

    if(! MLGetUTF16Symbol(lp, &symbol, &length, &characters))
            /* unable to read the UTF-16 symbol from lp */

    /* ... */

    MLReleaseUTF16Symbol(lp, symbol, length, characters);