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.
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\">åäö</textArea>" +
"<input name=\"field\" value=\"åäö\" /></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.
Since this works fine when using the JTidy parser with HttpUnit, it would seem to be a NekoHTML bug.