> -----Original Message----- > From: Kimbro Staken [mailto:[EMAIL PROTECTED] > Sent: 25 February 2002 13:02 > To: [EMAIL PROTECTED] > Subject: Re: [bug] encoding problems > > > > On Monday, February 25, 2002, at 04:51 AM, James Bates wrote: > >> > > correct (unfortunately). However English ascii is a subset > of UTF-8 so > > you should be ok there. > > > > Ok, that makes sense. > > > > Which transformer do you mean? > > > > + Transformer tf > + = TransformerFactory.newInstance().newTransformer(); > + tf.transform(new StreamSource(new FileInputStream(file)), > + new StreamResult(inString)); > > >>>>>
OK, sorry; it is Xalan's "transformer". calling newTransformer() with no arguments makes an "identity" transformer. It's just a trick on my part to be able to read in and parse a byte-array, detecting the encoding using the rules set out in the XML spec (Xerces sees to this), and then outputting that exact XML to a java.lang.String. (both javax.xml.stream.StreamSource and javax.xml.stream.StreamResult accept byte arrays or Strings as argument and perform necessary conversions correctly) James > Kimbro Staken - http://www.kstaken.org - http://www.xmldatabases.org > Apache Xindice native XML database http://xml.apache.org/xindice > XML:DB Initiative http://www.xmldb.org > Senior Technologist (Your company name here) > >>>> > >>>> > >>> > >> > >> > > > >