|
请教各路大侠,我以下代码发短信的时候中文乱码,是怎么回事?
void Send_SMS(const cjWCHAR *pcszPhoneNumber, const cjWCHAR *pcszMessageBody, int32 nMessageLen)
{
mmi_frm_sms_send_struct *sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
if(mmi_bootup_is_sim_valid())
{
MTPNP_AD_Set_Channel(MTPNP_AD_SMS_CHANNEL, MTPNP_AD_CHANNEL_MASTER);
wls_trace_str("choose sim1");
}
else
{
MTPNP_AD_Set_Channel(MTPNP_AD_SMS_CHANNEL, MTPNP_AD_CHANNEL_SLAVE);
wls_trace_str("choose sim2");
}
memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
sendData->dcs_class = SMSAL_CLASS1;
mmi_ucs2_to_asc((S8*) sendData->number,(S8*) pcszPhoneNumber);
sendData->dcs = SMSAL_UCS2_DCS;
sendData->stringlength = nMessageLen;
sendData->string = OslMalloc((nMessageLen + 1) * 2);
memset(sendData->string, 0, (nMessageLen + 1) * 2);
mmi_ucs2ncpy((PS8)sendData->string, (PS8) pcszMessageBody, nMessageLen);
mmi_frm_sms_send_sms(MTK_onSendSMS, MOD_MMI, sendData);
OslMfree(sendData);
} |
|