WSPutUTF8String (C 函数)
int WSPutUTF8String(WSLINK link,const unsigned char *s,int len)
把长度为 len 的 UTF-8 字符串 s 写入由 link 指定的 WSTP 连接.
范例
基本范例 (1)
#include "wstp.h"
/* send an Integrate[] expression to a link */
void f(WSLINK lp)
{
unsigned char *expr = "Integrate[1/Sin[x],x]";
if(! WSPutFunction(lp, "EvaluatePacket", 1))
{ /* unable to send the function to lp */ }
if(! WSPutFunction(lp, "ToExpression", 1))
{ /* unable to send the function to lp */ }
if(! WSPutUTF8String(lp, (const unsigned char *)expr, 21))
{ /* unable to send the expression to lp */ }
if(! WSEndPacket(lp))
{ /* unable to send the end-of-packet indicator to lp */ }
if(! WSFlush(lp))
{ /* unable to flush any buffered outgoing data to lp */ }
}