0 Replies Latest reply on Dec 15, 2006 11:44 PM by Paul Babyak

    UTF encoding in address field

    Paul Babyak Newbie

      I have some problem. It not fatal, but i don't known how to eliminate it.
      Jboss 4.0.5 GA ( with tomcat ).
      Tomcat connector was configured this way:

       <Connector port="80" address="${jboss.bind.address}"
       maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
       enableLookups="false" redirectPort="8443" acceptCount="100"
       connectionTimeout="20000" disableUploadTimeout="true"/>

      And in ROOT.war i place some test jsp-file (testenc.jsp, UTF-8 codepage)
      <%@ page import="java.net.URLEncoder" %>
      <%@ page import="java.util.Enumeration"%>
      <%@ page contentType="text/html;charset=UTF-8" %>
      <title>testenc.jsp page</title></head>
      <meta http-equiv="pragma" content="no-cache" />
      <!meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <% Enumeration pnms = request.getParameterNames();
       while (pnms.hasMoreElements()) {
       Object o = pnms.nextElement();
       String[] v = request.getParameterValues(o.toString());
       StringBuffer sb = new StringBuffer();
       for (int i = 0; i < v.length; i++) sb.append(v).append("|");
       %><tr><td><%=o.toString()%></td><td><%=sb.toString()%></td><td><%=request.getParameter(o.toString())%></td></tr><% }%>
       <a href="testenc.jsp?param=<%=URLEncoder.encode("???????", "UTF-8")%>">???????</a><br/>

      In bowser page showing normally, and reference working fine.
      But if i manually type "/testenc.jsp?param=???????" in url-field then browser recode Russian symbols in form:
      /testenc.jsp?param=%D0%F3%F1%F1%EA%E8%E9 (Windows-1251?)
      instead of:
      although with wikipedia.org browser works correctly.

      Sorry for my English. :)