cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject How to determine encoding?
Date Thu, 03 Aug 2000 19:09:16 GMT
Is there a way to determine what encoding was specified for an
XML document after parsing?

I'm referring to the case when an encoding is explicitly specified
in the XML declaration, like in:

  <?xml version="1.0" encoding="ISO-8859-5"?>

I've browsed the SAX and DOM javadocs looking for an "official"
way of determining the document's original encoding to no avail
so far... (Btw, my tests reveal that this declaration is _not_
processed as a processing instruction)

This would be very handy for XSP: for proper i18n support,
generated Java programs should be compiled using the same
encoding as the original document. Right now, the author must
specify (redundantly) the encoding as an attribute in the
<xsp:page> root element. We're working on making this root
element optional, so if there's a way of finding out what the
original encoding was we'd remove one more case in which the
<xsp:page> root element is necessary.

Any ideas?

Ricardo

Mime
View raw message