如题

解决方案 »

  1.   


    string data;byte[] encData_byte = new byte[data.Length];//get byte array of string data based on UTF-8 
    encData_byte = Encoding.UTF8.GetBytes(data);
      

  2.   

    string strCN = "中国";
    byte[] btCN = System.Text.Encoding.Default.GetBytes(strCN);
    string strUTF8 = System.Text.Encoding.UTF8.GetString(btCN);
      

  3.   

    是的,Console.Write(strUTF8);
    显示为乱码
      

  4.   

    哈哈,老兄啊,中文的UTF8编码,显示出来当然是乱码了
      

  5.   

    我是想得到这种形式的,该怎么办呢?
    %E4%B8%AD%E5%9B%BD