PDA

View Full Version : Java 1.4 - remove certain chars



andrew222
December 15th, 2009, 08:24 PM
I have a Java 1.4 application that submits an XML document to a Siebel CRMS system.

The business flow is that a user will enter data in a text field. this data entered is then marshalled into nodes in an XML document using JAXB. the XML document is encoded as UTF-16 as well.

I am having issues with users copying characters like the single qoute and double qoute characters from a .doc file and then pasting them into the text fields. This in turn will cause processing errors on the Siebel side.

I would like to know if there is a way which we can look for these characters and replace them with a version of that character from a .txt file, particularly with JDK 1.4?

Physical Hook
December 15th, 2009, 10:57 PM
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replace%28char,%20char%29 ?