网络上找的EncodeUtf8 这个  在编译这些 如: “特7” 这样的字段时候 就丢失 “7” 只有“特”求个大家用过的没BUG 的 谢谢 网络上的是这个function EncodeUtf8(s1)
  {
      var s = escape(s1);
      var sa = s.split("%");
      var retV ="";
      if(sa[0] != "")
   ...........
   ...........

解决方案 »

  1.   

    不知道你是不是用在读取COOKIE操作,给你个示例<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body><script type="text/javascript">
    function writeCookie(name, value, hours)
    {
      var expire = "";
      if(hours != null)
      {
        expire = new Date((new Date()).getTime() + hours * 3600000);
        expire = "; expires=" + expire.toGMTString();
      }
      document.cookie = name + "=" + escape(value) + expire;
    }
    function readCookie(name)
    {
      var cookieValue = "";
      var search = name + "=";
      if(document.cookie.length > 0)
      { 
        offset = document.cookie.indexOf(search);
        if (offset != -1)
        { 
          offset += search.length;
          end = document.cookie.indexOf(";", offset);
          if (end == -1) end = document.cookie.length;
          cookieValue = unescape(document.cookie.substring(offset, end))
        }
      }
      return cookieValue;
    }writeCookie("aa","特7",24)
    alert(readCookie("aa"))
    </script>
    </body>
    </html>
      

  2.   

    楼上的朋友 先谢谢    不过我要的是个 JS utf8编码转换方法   搜的那个有BUG