byte[] bytes = System.Text.Encoding.Unicode.GetBytes("胡");
string lowCode = "", temp = "";
for (int i = 0; i < bytes.Length; i++)
{
if (i % 2 == 0)
{
temp = System.Convert.ToString(bytes[i], 16);//取出元素4编码内容(两位16进制)
if (temp.Length < 2) temp = "0" + temp;
}
else
{
string mytemp = Convert.ToString(bytes[i], 16);
if (mytemp.Length < 2) mytemp = "0" + mytemp; lowCode = mytemp + temp;//取出元素4编码内容(两位16进制)
}
}
int s = (int)'A';
字符集之间转换(UTF-8,UNICODE,Gb2312)
特搜集了UTF-8,UNICODE,Gb2312他们3个之间的相互转换.
string lowCode = "", temp = "";
for (int i = 0; i < bytes.Length; i++)
{
if (i % 2 == 0)
{
temp = System.Convert.ToString(bytes[i], 16);//取出元素4编码内容(两位16进制)
if (temp.Length < 2) temp = "0" + temp;
}
else
{
string mytemp = Convert.ToString(bytes[i], 16);
if (mytemp.Length < 2) mytemp = "0" + mytemp; lowCode = mytemp + temp;//取出元素4编码内容(两位16进制)
}
}
int s = (int)'A';
字符集之间转换(UTF-8,UNICODE,Gb2312)
特搜集了UTF-8,UNICODE,Gb2312他们3个之间的相互转换.