I have an input box in my web app, If I type the following input:
char ʃƪ
on server side when I try to build an xml doc using Jdom it crashes raising the following exception:
org.jdom.IllegalDataException: The data “char (3A” is not legal for a JDOM attribute: 0x1a is not a legal XML character.
at org.jdom.Attribute.setValue(Attribute.java:491)
at org.jdom.Attribute.<init>(Attribute.java:228)
at org.jdom.Attribute.<init>(Attribute.java:251)
at org.jdom.Element.setAttribute(Element.java:1128)
this is how the browser encodes the ajax call
…&MESSAGE=char%20(3%1AA
on server side when I do
pRequest.getParameter(“MESSAGE”);
it returns me: “char (3A“
Any ideas what’s going on there?
It is working now.
I switched from the jQuery plug-in URLEncode to the native javascript function:
Moreover I found out that in an ajax call you can specify the contentType