Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Question regarding encoding

Sinkinson,Andrew [NCR]

2004-10-07

Replies:

Question regarding encoding

  Hi All,

  Why are my French apostrophe being converted to questions marks ?
  If I have the following input Xml document:

  <?xml version="1.0" encoding="ISO-8859-1"?>
<record>
    <description>L’architecture de GI/TI </description>
</record>

  Parse the document with jdom and write it to the file system with the following format
  Format format = Format.getCompactFormat().setEncoding("ISO-8859-1");                    
  XMLOutputter out = new XMLOutputter(format);
  FileWriter f = new FileWriter(new File(filename));
  out.output(doc, f);

  Here is the output:
<?xml version="1.0" encoding="ISO-8859-1"?>
<record><description>L?architecture de GI/TI</description></record>

  Any help would be greatly appreciated.
 Thanks,
  Andrew

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.