Unicode対応Essbaseアプリケーションとの通信にCのメインAPIを使用するUnicodeクライアントは、次の関数の呼出し直後に、テキスト・ストリーム内のUTF-8でエンコードされたバイト・オーダー・マーク(BOM)を送信する必要があります:
BOMを送信するには、次の例に示されているようにuse EssSendStringを使用します:
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");
}