Menu

textArea decodec differently from input field

2003-03-12
2003-03-13
  • Mattias Jiderhamn

    I don't know if this is a HttpUnit issue or a NekoHTML issue.

    The value of a textarea is decoded differently than the value of a input text field, or rather textareas are not decoded at all. With decoding I mean the conversion from HTML escape sequences to text. In Sweden we have some national characters (/) which our application sends as escape sequences (å ä ö). When inside a input field, they are interpreted as the Swedish characters, but when inside a textarea the escape sequences are returned.

    A test case to prove this:

        public void testCharacterEncoding() throws Exception {
          defineWebPage("Default", "<form><textArea name=\"area\">&#229;&#228;&#246;</textArea>" +
              "<input name=\"field\" value=\"&#229;&#228;&#246;\" /></form>");
            WebConversation wc = new WebConversation();
            WebResponse response = wc.getResponse( getHostPath() + "/Default.html" );
            WebForm form = response.getForms()[0];
            assertEquals("Field ", "", form.getParameterValue("field")); // Passes
            assertEquals("Area ", "", form.getParameterValue("area")); // Fails
        }

    If somebody could help me with wether this is a problem with HttpUnit or Neko, I will post it as a bug where appropriate.

     
    • Russell Gold

      Russell Gold - 2003-03-13

      Since this works fine when using the JTidy parser with HttpUnit, it would seem to be a NekoHTML bug.

       

Log in to post a comment.

Auth0 Logo