Hi problem in Input stream - Junk character

Hi

We are developing a application in which a java servlet reads a request from a xls file

The request is sent from a macro written in excel file.

The request sends a xml file content in byte form.

This we read in the servlet as a datainputstream.

While printing we encounter a problem

After every valid character a junk character is also getting printed(it is in form of a square).

example

< (junk) x (junk) m (junk).............

Can somebody help how to solve this

Thanks

Ottran

Message was edited by:

Ottran

[600 byte] By [Ottrana] at [2007-10-3 2:52:03]
# 1
Either you have garbage in your file, or you're reading it wrong.
jverda at 2007-7-14 20:40:58 > top of Java-index,Java Essentials,Java Programming...
# 2

Sounds to me like the XML is being encoded in some version of UTF-16, but you're ignoring that and acting as if it's in some single-byte encoding. I would certainly question the use of DataInputStream to read it, as that class has assumptions built into it which you could easily misuse.

And "printing" is a term that could use a whole lot of clarification, especially in the context of a Web application.

DrClapa at 2007-7-14 20:40:58 > top of Java-index,Java Essentials,Java Programming...