总结:VC小知识! >>
<< 9月底机器坏掉
Set accept-charset to form

Author Zhou Renjian Create@ 2005-01-06 23:59
whizz Note icon

For example:
            <form accept-charset="gb2312" action="/whizznotes/search" method="get">
                <table cellpadding="0" cellspacing="0" border="0" width="90%">
                    <tr>
                        <td align="center">
                            <table cellpadding="2" cellspacing="2" border="0">
                                <tr>
                                    <td align="right">
                                        <input onkeyup="syncAllQuery(this);" onchange="syncAllQuery(this);" type="text" id="whizzQuery" name="query" style="background-color:transparent;padding:1px;font-family:Arial, sans-serif;border:solid 1px #8b0000;"/>
                                    </td>

                                    <td align="left">
                                        <input type="submit" value="wHizz Search" style="font-weight:bold;font-family:Arial, sans-serif;color:yellow;background-color:#8b0000;border:solid 1px black;"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </form>
Then in the server side, server can always treat the query as "iso-8859-1":
    String queryWords = new String(request.getParameter("query").getBytes("iso-8859-1"), "gb2312");

Problem solved.

本记录所在类别:
本记录相关记录: