public string toGB2312(string thestr)
{
Byte[] encodedBytes = new byte[thestr.Length * 2];
int iCount = Encoding.GetEncoding("gb2312").GetBytes(thestr, 0, thestr.Length, encodedBytes, 0);
string GetGB22312String = "";
foreach (Byte b in encodedBytes)
{
string strValue = Convert.ToString(b, 16);
//strValue = strValue.ToUpper();
GetGB22312String += "%" + strValue;
}
return GetGB22312String;
}
{
Byte[] encodedBytes = new byte[thestr.Length * 2];
int iCount = Encoding.GetEncoding("gb2312").GetBytes(thestr, 0, thestr.Length, encodedBytes, 0);
string GetGB22312String = "";
foreach (Byte b in encodedBytes)
{
string strValue = Convert.ToString(b, 16);
//strValue = strValue.ToUpper();
GetGB22312String += "%" + strValue;
}
return GetGB22312String;
}
public string toGB2312(string thestr)
{
Byte[] encodedBytes = new byte[thestr.Length * 2];
encodedBytes = Encoding.GetEncoding("gb2312").GetBytes(thestr);
string GetGB22312String = "";
foreach (Byte b in encodedBytes)
{
string strValue = Convert.ToString(b, 16);
//strValue = strValue.ToUpper();
GetGB22312String += "%" + strValue;
}
return GetGB22312String;
}