Unicode clients using the C Main API to communicate with Unicode-enabled Essbase applications must send the UTF-8 encoded Unicode byte order mark (BOM) in the text stream immediately after calling any of the following functions:
To send the BOM, use EssSendString, as shown in the following examples:
void ESS_BeginUpdate()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_BOOL_T Store;
ESS_BOOL_T Unlock;
ESS_STR_T query = "";
/* Begin Update */
Store = ESS_TRUE;
Unlock = ESS_FALSE;
sts = EssBeginUpdate (hCtx, Store, Unlock);
printf("EssBeginUpdate sts: %ld\n",sts);
/* Send update specification */
//String with BOM characters
query = "\xEF\xBB\xBF 'marché' 'New York' 'Actual' 'Sales' '100-10' 5";
if(!sts)
sts = EssSendString(hCtx, query);
/* End Update */
if(!sts)
sts = EssEndUpdate(hCtx);
}
void ESS_BeginReport()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_STR_T rString = ESS_NULL;
ESS_STR_T query = ESS_NULL;
sts = EssBeginReport (hCtx, ESS_TRUE, ESS_FALSE);
printf("EssBeginReport sts: %ld\n",sts);
if(!sts)
{
//String with BOM characters
query = "\xEF\xBB\xBF 'New York' 'Actual' 'Sales' '100-10' 'marché' 'Jan' !";
sts = EssSendString(hCtx, query);
}
if(!sts)
sts = EssEndReport (hCtx);
if(!sts)
sts = EssGetString(hCtx,&rString);
while ((!sts) && (rString != NULL))
{
printf("%s", rString);
EssFree (hInst, rString);
sts = EssGetString (hCtx, &rString);
}
printf("\n");
}