cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject Re: How to determine encoding?
Date Fri, 04 Aug 2000 10:19:15 GMT
At 14:09 -0500 03/08/00, Ricardo Rocha wrote:
>
>Is there a way to determine what encoding was specified for an
>XML document after parsing?

I doubt this helps ....

But I did something like this in the FP TagLib fpResource Library:


public Document loadDocument(File f) {
	DOMParser parser = new DOMParser();
	try {
		InputSource is = new InputSource(f.toString());
		String enc = is.getEncoding();
		if (!enc.equals("")) { workEncoding = enc; }
		parser.parse(is);
	} catch (Exception e) {}
}

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

Mime
View raw message