Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > MathLink C Language Functions >
MathLink C Function

MLGetUTF32String()

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

/* read a UTF-32 encoded string from a link */

void f(MLINK lp)
{
    const unsigned int *string;
    int len;

    if(! MLGetUTF32String(lp, &string, &len))
        {
            /* unable to read the UTF-32 string from lp */
            return;
        }

    /* ... */

    MLReleaseUTF32String(lp, string, len);
}
© 2013 Wolfram Research, Inc. Japanese
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team