OpenersNotesSection(Spacer1)Details

WSPutUTF32String() 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[WSError(), paclet:ref/c/WSError]) to retrieve the error code if WSPutUTF32String() fails.

WSPutUTF32String() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wst.h"

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

void f(WSLINK 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(! WSPutFunction(lp, "EvaluatePacket", 1))
		{ /* unable to put the function to lp */ }

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

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

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

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

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSPutString(), paclet:ref/c/WSPutString])  ▪  (NonWLLink[WSPutByteString(), paclet:ref/c/WSPutByteString])  ▪  (NonWLLink[WSPutUCS2String(), paclet:ref/c/WSPutUCS2String])  ▪  (NonWLLink[WSPutUTF8String(), paclet:ref/c/WSPutUTF8String])  ▪  (NonWLLink[WSPutUTF16String(), paclet:ref/c/WSPutUTF16String])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(RefLinkPlain[Portability of WSTP Programs, paclet:tutorial/PortabilityOfWSTPPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Strings, paclet:guide/WSTPCFunctionsForExchangingStrings])}})}})