看看效果:http://watson.cxc.cc/gbbig.htm

解决方案 »

  1.   

    <?    
    ////////////////////////////////////////////  
    //作者:                                        网络骑士              //  
    //联系方式:[email protected]  //  
    //所用技术:php                                                      //  
    //完成时间:2002-05-12                                        //  
    ///////////////////////////////////////////  
    function  isbig5($code)    
    {    
    if  (strlen($code)>=2)    
    {    
    $code=strtok($code,"");    
     
    if  (ord($code[0])  <  161)    
    {    
    return  (0);    
    }    
    else    
    {    
    if  (((ord($code[1])  >=  64)&&(ord($code[1])  <=  126))  &brvbar;  &brvbar;((ord($code[1])  >=  161)&&(ord($code[1])  <=  254)))    
    {    
    return  (1);    
    }    
    else    
    {    
    return  (0);    
    }    
    }    
    }    
    else    
    {    
    return  (0);    
    }    
    }    
     
    function  big5offset($code)    
    {    
    if  (strlen($code)  >=  2)    
    {    
    $code=strtok($code,"");    
    if  ((ord($code[1])  >=  64)&&(ord($code[1])  <=  126))    
    {    
    return  ((ord($code[0])  -  161)  *  157  +  (ord($code[1])  -  64));    
    }    
    if  ((ord($code[1])  >=  161)&&(ord($code[1])  <=  254))    
    {    
    return  ((ord($code[0])  -  161)  *  157  +  63  +  (ord($code[1])  -  161));    
    }    
    }    
    return  (-1);    
    }    
     
    function  wordtostring($code)    
    {    
    return  (chr(hexdec(substr($code,0,2))).chr(hexdec(substr($code,2,2))));    
    }    
     
    function  big5togb($code)    
    {    
    include  "data_big5.php";    
    $output="";    
    $length=strlen($code);    
    $code=strtok($code,"");    
    $idx=0;    
    while  ($idx  <  $length)    
    {    
    $tmpStr=$code[$idx].$code[$idx+1];    
     
    if  (isbig5($tmpStr))    
    {    
    $offset=big5offset($tmpStr);    
    if  (($offset  >=  0)  &brvbar;  &brvbar;($offset  <=  14757))    
    {    
    $output.=wordtostring($big5order[$offset]);    
    $idx++;    
    }    
    else    
    {    
    $output.=  $code[$idx];    
    }    
    }    
    else    
    {    
    $output.=  $code[$idx];    
    }    
    $idx++;    
    }    
    return  ($output);    
    }    
    ?>
      

  2.   

    其实很简单 改变head 区中的META标签中的cherest即可
    例如简体就是<meta http-equiv="content-Type" content="text/html"; charset=gb123>
      

  3.   

    charset只能改变编码,不能把繁体转为简体
      

  4.   

    content-Type 可以设定显示的字符集  也可以设定页面
      

  5.   

    <meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">和
    <meta http-equiv="Content-Language" content="zh-CN">说明所用语言及文字... 
      

  6.   

    你可以试试
    繁体:<meta http-equiv="content-type" content="text/html; charset=Big5">
      

  7.   

    其实最快的还是用JS实现,用PHP的话,我个人认为没有那个必要,还要提交服务器处理后再反馈一个页面。
    用JS的好处是,在你的网站上如果有这样的链接"简体版|繁体版",只要点链接,很快就换了。速度上可以接受,况且又不是做研究,没必要哪个字都转换,只要能在执行效率和可用性以及实用性上平衡一下,这就是好的方案,最优的解决途径。
      

  8.   

    to  wanzhen([ Pisces ]) :
    js是怎么做的??能不能贴点代码参考参考
      

  9.   

    CSS又是如何把简体转换成繁体的呢?
      

  10.   

    to xinyaoxp(henonybee) http://watson.cxc.cc/gbbig.htm其实我说JS好用实际上是指不用刷新,不用提交服务器,就能将页面在繁体和简体之间随意切换。