};
#endregion
public static string Convert(string str)
{
if (str == null )
return null;
Encoding ed = Encoding.GetEncoding("GB2312");
if (ed == null)
throw (new ArgumentException("没有找到编码集GB2312"));
int bh = 0;
char[] charary = str.ToCharArray();
byte[] bAry = new byte[2];
StringBuilder rtnSb = new StringBuilder();
for(int i = 0; i< charary.Length; i++)
{
bAry = ed.GetBytes(charary[i].ToString());
if (bAry.Length == 1)
{
rtnSb.Append(charary[i]);
continue;
}
bh = bAry[0] - 0xA0;
bool isFind = false;
for (int j = 0; j< _Allhz.Length;j++)
{
if (_Allhz[j][1].IndexOf(charary[i])!=-1)
{
rtnSb.Append(_Allhz[j][0]);
isFind = true;
break;
}
}
if (!isFind)
rtnSb.Append(charary[i]);
}
return rtnSb.ToString();
}
}
}
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-23251-27.html
如果是漏过气的到是很正常
奋斗
写出来也不认真
说不行贿