你是不是在传递之前转换成UTF-8字码了?WAP现在都是UTF-8的。那么把它转换过来成GB2312字码的就可以了。。用函数iconv()

解决方案 »

  1.   

    你先用echo返回那个$teacher'看看是不是乱码?
      

  2.   

    用iconv()转的在opera上可以用,但是在手机上就用不了了!
      

  3.   

    用iconv()转的在opera上可以用,但是在手机上就用不了了!是什么意思?是函数不能用,还是还会有乱码,手机不懂。
      

  4.   

    test.wml
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    <card id="no1" title="Card 1"> 
    <p>
    请输入您的个人信息:<br/>
    <b>您的姓名:</b><br/><input name="name" format="*m" emptyok="true" value=""/><br/>
    </p>
    <p align="center">
    <do type="accept" label="提交">
    <go href="test.php" method="get">
    <postfield name="send" value="1"/>
    <postfield name="name" value="$(name)"/> 
    </go>
    </do>
    </p>
    </card>
    </wml>test.php
    <?php
    $info=$_GET['name'];
    $handle=fopen("test.txt","w");
    flock($handle,LOCK_EX);
    fwrite($handle,$info);
    flock($handle,LOCK_UN);
    fclose($handle);
    header("Location: test.wml");
    ?>
    运行后在test.txt下可以显示正确中文
    我是用M3GATE测试
    我还不怎么用PHP怎么生成WML文件呢。。HEADER里要输出什么?我尝试了一下header一个application/wml。不行。。