OpenersNotesSection(Spacer1)Details

MLPutUTF32String() returns 0 in the event of an error, and a nonzero value if the function succeeds.

The string s must start with a byte order mark.

The length of the string len must include the byte order mark.

Use (NonWLLink[MLError(), paclet:ref/c/MLError]) to retrieve the error code if MLPutUTF32String() fails.

MLPutUTF32String() is declared in the MathLink header file (RefLink[mathlink.h, paclet:ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

/* send the expression N[10/Sin[2]] as a UTF-32 string to a link */

void f(MLINK lp)
{
	unsigned int expr[13];

	expr[0]  = 0xFEFF;
	expr[1]  = 'N';
	expr[2]  = '[';
	expr[3]  = '1';
	expr[4]  = '0';
	expr[5]  = '/';
	expr[6]  = 'S';
	expr[7]  = 'i';
	expr[8]  = 'n';
	expr[9]  = '[';
	expr[10] = '2';
	expr[11] = ']';
	expr[12] = ']';

	if(! MLPutFunction(lp, "EvaluatePacket", 1))
		{ /* unable to put the function to lp */ }

	if(! MLPutFunction(lp, "ToExpression", 1))
		{ /* unable to put the function to lp */ }

	if(! MLPutUTF32String(lp, (const unsigned int *)expr, 13))
		{ /* unable to put the expression string to lp */ }

	if(! MLEndPacket(lp))
		{ /* unable to put the end-of-packet indicator to lp */ }

	if(! MLFlush(lp))
		{ /* unable to flush any outgoing data buffered in lp */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLPutString(), paclet:ref/c/MLPutString])  ▪  (NonWLLink[MLPutByteString(), paclet:ref/c/MLPutByteString])  ▪  (NonWLLink[MLPutUCS2String(), paclet:ref/c/MLPutUCS2String])  ▪  (NonWLLink[MLPutUTF8String(), paclet:ref/c/MLPutUTF8String])  ▪  (NonWLLink[MLPutUTF16String(), paclet:ref/c/MLPutUTF16String])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}})}})