You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Pramodh Peddi <pe...@contextmedia.com> on 2003/11/06 09:05:40 UTC

Directly referenced special characters as "?"

Hi,
I couldn't solve my problem fully yet. I posted a request a couple of days
ago and the responses helped me a bit, but not entirely.

I am having an xml (source) file which has  different special characters -
some of which are referenced thru entities (like &#8482) and others are
referenced directly (like ® and ©). The entity referenced characters are
coming up fine while transforming, but the directly referenced chars are
coming up as "?" chars.

I am using Java1.4.2's Transformer for transforming.

This is what I am doing on the Java code:
*********************************************************

if (filePath != null) {

sftp.get(filePath, rawfileOutputStream);

rawfileOutputStream.close();

}

ByteArrayInputStream rawfileInputStream = new
ByteArrayInputStream(rawfileOutputStream.toByteArray());

ByteArrayOutputStream transformedFileOutputStream = new
ByteArrayOutputStream();


File transformedFile = new File("../server/ic/deploy/data.war/" +
this.taxXSLTResult);

FileOutputStream out = new FileOutputStream(transformedFile);


transformer.transform(

new StreamSource(new InputStreamReader(rawfileInputStream), this.dtdURL),

new StreamResult(out));

rawfileInputStream.close();

transformedFileOutputStream.close();

****************************************************************************
********************

The source file has "windows-1252" encoding header. And in xsl, I tried xsl:
encoding="iso-8859-1" and xsl: encoding = "windows-1252". Niether of these
worked. I even tried to shange the bytes into String and again into bytes.
Nothing works.

I would really appreciate if anyone I can get any help!!


Thanks in advance,

Pramodh.