[jdom-interest] SaxBuilder.build(url) and encoding

Rodrigo Alvarez ralvarez at dybox.cl
Wed Dec 11 13:00:03 PST 2002


I´ve a problem with encoding and using SaxBuilder.build(url) method.
It seems that the SaxBuilder.build(url) method does not check for the 
encoding attribute in the xml head tag
Is this correct, or is it just me?
The following xml does give a JDOMException[Malformed UTF-8 char] when read 
by SaxBuilder.build(url) but works
fine when read by SaxBuilder.build(File) or SaxBuilder.build(String)

<?xml version="1.0" encoding="ISO-8859-1"?>
   <current_date week_day="mié">

My solution to the problem was read URL stream into a StringBuffer and then 
build Document object.
I´m not satisfied with this solution so I wonder if someone else have had a 
similar problem or can confim that
there really is a problem with JDOM.


Rodrigo Alvarez
DyBOX Consulting and Development

Hernando de Aguirre 906 Providencia.
Santiago, Chile.
(562) 231 7840

More information about the jdom-interest mailing list