在网上找到的所有发的帖子都是用accii编码.不过好象是主流的是用utf8编码.真是头疼.刚接触这个.net.也不知道应该怎么弄.

解决方案 »

  1.   

    这个还真不不清楚,
    不过我再做网站时上传到英文服务器上时有的中文字符会成为乱码显示,这时 
    保存成utf8并且带签名的,上传上去再浏览就不是乱码了.
    关于accii,我的手机上可以看电子书(文本形式的),可是,我把一些文本放上去看到的是乱码,最后我发现保存成 accii格式的就可以了继续学习
      

  2.   

    外文的东西好像 用utf8 比较多
      

  3.   

    楼主的意思是ASCII吧?
    ACSII是计算机发明不久就创建的编码方式,当时计算机只有在美国用,所以只要表示字母和特殊符号就行,一共256个。
    后来计算机进入中国,为了表示汉字中国发明了GB2312编码。
    但是后来由于编码标准太多(很多国家都有自己的编码。)所以产生了统一的unicode编码。
    utf-8是unicode编码方式
      

  4.   

    unicode基本可以表示世界上所有的符号。
    现在用utf-8吧。统一的规范总归是好的
      

  5.   

    坏了.费了老半天的劲才弄的这个是用accii 代码,现在要用utf8编码不会啊,真实麻烦。
    ASCIIEncoding encoding=new ASCIIEncoding();
    string postData="COMMANDID=05";
    byte[]  data = encoding.GetBytes(postData);
    // Prepare web request
    HttpWebRequest myRequest =(HttpWebRequest)WebRequest.Create("http://61.156.3.58/test.jsp");
    myRequest.Method = "POST";
    myRequest.ContentType="application/x-www-form-urlencoded";
    myRequest.ContentLength = data.Length;
    Stream newStream=myRequest.GetRequestStream();
    // Send the data.
    newStream.Write(data,0,data.Length);
    newStream.Close();
    HttpWebResponse  webResponse=(HttpWebResponse)myRequest.GetResponse();  
    Stream stream=webResponse.GetResponseStream();
    System.IO.StreamReader streamReader = new StreamReader(stream, System.Text.Encoding.GetEncoding("GB2312"));
    string content = streamReader.ReadToEnd();
    // 关闭相关对象
    Console.WriteLine (content);
    streamReader.Close();
    webResponse.Close();
      

  6.   

    private void post(string url, string content)
    {
          Encoding encoding = Encoding.GetEncoding("GB2312");
          byte[] data = encoding.GetBytes("xml="+content);      // 准备请求...
          HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
          myRequest.Method = "POST";
          myRequest.ContentType="application/x-www-form-urlencoded";
          myRequest.ContentLength = data.Length;
          Stream newStream=myRequest.GetRequestStream();
          // 发送数据
          newStream.Write(data,0,data.Length);
          newStream.Close();
    }
    找到一个发送的文档,呵呵,先比着凑合着弄弄.
      

  7.   

    啥主流,统一utf。要不代码在不同语言的OS上就乱码了