c#怎么把某个繁体字变为简体字页面显示的是繁体字,但数据库的是简体字, 我怎么用C#把繁体字变为简体,才能读取数据库的数据

解决方案 »

  1.   

    那你将页面的编码格式更改成gb2312,最好是同一成UTF-8
      

  2.   

    汗汗 你这个要求 太那个了    不过还是有解决办法的  直接把简体的和繁体的转换下就好了 ~~~~至于转换的代码 网上很多 这里 
    http://blog.csdn.net/marvinhong/archive/2008/11/03/3211702.aspx
      

  3.   

    //简体转繁体
      private static string getBig5(string gb2312)
      {
      string result = "";
      if ((gb2312 != null) && (gb2312 != String.Empty))
      {
      gb2312 = gb2312.Trim();
      result = Strings.StrConv(gb2312, VbStrConv.TraditionalChinese, 0);
      }
      return result;
      }  //繁体转简体
      private static string getGb2312(string big5)
      {
      string result = "";
      if ((big5 != null) && (big5 != String.Empty))
      {
      big5 = big5.Trim();
      result = Strings.StrConv(big5, VbStrConv.SimplifiedChinese, 0);
      }
      return result;
      }
      

  4.   

    //引用Miscrosoft.VisualBasicusing Microsoft.VisualBasic;public static string Traditional2Simplified(string str)
            { //繁体转简体
                return (Strings.StrConv(str, VbStrConv.SimplifiedChinese, 0));        }
            public static string Simplified2Traditional(string str)
            { //简体转繁体
                return (Strings.StrConv(str as String, VbStrConv.TraditionalChinese, 0));        }
      

  5.   

    操作了fileurl = "<a href='/Admin/PlanUploadFile/" + Big5ToGb2312.getGb2312(fileList[i].FileName) + "' target='_blank'>" + fileList[i].FileName + "</a>";
                         myfileList.Add(fileurl);繁体的还是 没有变成简体,没有发生变化。 怎么不行的呢
      

  6.   

    本来我页面时 UTF-8的 但是在VS2008看的文字是简体的,但浏览运行时 页面上显示的文字 竟然是繁体的。
    为什么会这样的呢? 怎么变化这样的呢了。