Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Character conversion in SAX Parser



I have a problem … a very peculiar one could you please guide.

Original message: Kevätsunnuntaisin lentää

The flow of data is HttpConnector -> WSDLConnector -> to the underlying system

The following is the encoding of the first 7 characters

4b 65 76 c3 a4 74 73 75 – In Http Connector – the request XML has UTF-8 encoding

4b 65 76 a3 74 73 75 – in WSDL Connector -

InputSource inputSource = new InputSource(myInputStream); inputSource.setEncoding("UTF-8");

parser.parse(inputSource);

The original string gets converted to Kev£tsunnuntaisin lent££.Also, there is a loss of a byte.

Could you please guide me where I am going wrong? What must I do to avoid this character conversion?

Thanks for your help!!!