public string UtfEncode(string str)
{
byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes(str);
string result = "";
for (int i = 0; i < buffer.Length; i++)
{
result = result + "%" + buffer[i].ToString("x");
}
return result;
}