xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gus Heck <gus.h...@olin.edu>
Subject Re: Getting encodings to match (solved)
Date Thu, 15 Jan 2004 19:04:10 GMT
Solved my own problem... It seems that the jvm was asigning the local 
default encoding to any file it opened (in the entity resolver), and by 
specifying the desired encoding in the InputStreamReader the problem 
goes away.

in otherwords I changed:

            InputStreamReader isr = new InputStreamReader(
            SimulationPanel.class.getResourceAsStream(sys));

to

            InputStreamReader isr = new InputStreamReader(
            SimulationPanel.class.getResourceAsStream(sys),"UTF8");

-Gus

Gus Heck wrote:

> I have a program to which I added a "save as template" feature. The 
> template is an xml file and on my development box everything works 
> great. However upon deployment it seems that something with encodings 
> has been screwed up. I'm working in Java, so I include the DTD in the 
> jar and load it using a custom entity resolver that looks it up on the 
> classpath. It seems that for whatever reason, the DTD file in the jar 
> is getting converted to ISO8859_1 instead of UTF8. The parser will let 
> me leave the encoding delcaration out of the main xml file, but the 
> included DTD apparetly requires it.
>
> My current theory is that the change is happening either when the file 
> goes in and out of CVS, or the encoding is getting changed when Ant 
> builds the jar. Lastly, I noticed that the production machine is 
> running old java (1.4.0) and I am running 1.4.2.
>
> Anyone know which of these is most likely the problem, or have a 
> suggestion for ensuring that the encoding declaration always matches?
>
> - Gus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message