cdma中文短信编码,请有cdma经验的指点一二(高分求助,如能解决问题可再送分)
我是采用如下方法编码的,但对方收到的时部分是乱码
//将短信内容编码
private string GetMessage(string strValue)
{
string strTemp="";
int iLen=0;
Byte[] bt=new Byte [1024];
Byte btTemp=new Byte();
string strValue1=strValue;
System.Text .Encoding .Unicode .GetBytes (strValue1,0,strValue1.Length ,bt,0);
for(int i=0;i<bt.Length ;i=i+2)
{
if(bt[i]==0 && bt[i+1]==0)
{
iLen=i;
i=bt.Length ;
}
else
{
btTemp=bt[i];
bt[i]=bt[i+1];
bt[i+1]=btTemp;
}
}
strTemp=System.Text .Encoding .ASCII .GetString (bt,0,iLen);
return strTemp;
}