简体繁体判断
Boolean IsBig5(string strOne)
{
Boolean bIsBig5 = false;
byte[] ByteArrayBig5 = System.Text.Encoding.GetEncoding("big5").GetBytes(strOne);
if (ByteArrayBig5.Length == 2)
{
//check A440~C67E 常用字, C940~F9D5 次常用字
//42048~50814, 51520~63957
int iCode = ByteArrayBig5[0] * 256 + ByteArrayBig5[1];
if ((iCode >= 42048 && iCode <= 50814) || (iCode >= 51520 && iCode <= 63957))
{
// chinese char big5
bIsBig5 = true;
}
}
return bIsBig5;
}
{
Boolean bIsBig5 = false;
byte[] ByteArrayBig5 = System.Text.Encoding.GetEncoding("big5").GetBytes(strOne);
if (ByteArrayBig5.Length == 2)
{
//check A440~C67E 常用字, C940~F9D5 次常用字
//42048~50814, 51520~63957
int iCode = ByteArrayBig5[0] * 256 + ByteArrayBig5[1];
if ((iCode >= 42048 && iCode <= 50814) || (iCode >= 51520 && iCode <= 63957))
{
// chinese char big5
bIsBig5 = true;
}
}
return bIsBig5;
}