Posted By:
Andy_Jefferies
Posted On:
Tuesday, December 18, 2001 07:51 AM
I'm trying to write a PDF File to a JSPWriter, but have found that character encoding is getting in the way. I have Buffered the file from disc with either a BufferedReader or BufferedInputStream where approriate, and loop until the input dries up. Using a FileReader, the bytes get all screwed up and so writing to the JSPWriter produces a bad result. A FileInputStream with an InputStreamReader and encoding set to default, "ASCII", and "US-ASCII" all failed too. I have succeeded by using two buffers, one byte[] and one char[] and after each read from a FileInputStream loop though the buffer and cast each individual byte to char before writing to the JSPWriter, but it seems to me that
More>>
I'm trying to write a PDF File to a JSPWriter, but have found that character encoding is getting in the way. I have Buffered the file from disc with either a BufferedReader or BufferedInputStream where approriate, and loop until the input dries up.
Using a FileReader, the bytes get all screwed up and so writing to the JSPWriter produces a bad result.
A FileInputStream with an InputStreamReader and encoding set to default, "ASCII", and "US-ASCII" all failed too.
I have succeeded by using two buffers, one byte[] and one char[] and after each read from a FileInputStream loop though the buffer and cast each individual byte to char before writing to the JSPWriter, but it seems to me that this might be a poor way of doing it.
Any better solutions?
<<Less