Search code examples
tomcatjava-8apache-axisaxistomcat8

How to make Tomcat 8 recognize unicode characters, e.g.: "start of text": 


How to make Tomcat 8 recognize unicode characters in response? E.g. "start of text":  which it should convert to:  (as stackoverflow and Weblogic do by default).

Why is Tomcat not able to do the same? Or should this be configured instead in the generated webservice client that we are using to do the call?

Axis 1.4's SAX parser crashes when it finds  in the response, Axis 2 at least it returns just null. We don't have a wide range of tools to use to generate our webservice clients because we're using SOAP messages and rpc/encoded wsdls.

I'm about to try this idea, of implementing a HTTP client to send and receive the data as String: Axis 1.4 can't deserialize response.

Is there something else that I can try to get this working?


Solution

  • Tomcat does not particularly have a problem with that character. If you hardcode that character in your code, it won't really fail.

     is just an XML/HTML entity.
    It is encoding the character nr. 2 in the ASCII table, which is "Start of Text".

    Have a look here -- http://www.asciitable.com/

    The first 31 characters in the ASCII table are control characters and it doesn't make much sense to have them being sent in the webservice.

    Either you have to get the webservice not sending those characters (could it be bad data on the database or something wrong with the code), or you have to get the client (Tomcat?) to filter those characters out.