You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Hermann Angstl <ha...@camline.com> on 2003/01/20 15:23:16 UTC

org.xml.sax.SAXException: The encoding "ASCII" is not supported

Hi,

i am using xerces (tried both, DOM and SAX) and get the following
exception:

org.xml.sax.SAXException:  The encoding "ASCII" is not supported

my code:
...
Parser parser =
ParserFactory.makeParser("org.apache.xerces.parsers.SAXParser");
parser.setDocumentHandler(this);
parser.setErrorHandler(this);
parser.parse(myURL);
...

The XML i want to parse:

<?xml version="1.0" encoding="ASCII" ?>
<connector_desc>
<app_desc name="MainApp" buffersize="0" urlVersion="2">
<instance id="1" port="1823" host="ibm-01" />
<instance id="2" port="1824" host="ibm-01" />
</app_desc>
</connector_desc>


Enable/disable validation doesn't change anything :((
Does this really mean that the parser can't parse US-ASCII ?

cu,
hal


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: org.xml.sax.SAXException: The encoding "ASCII" is not supported

Posted by Elliotte Rusty Harold <el...@metalab.unc.edu>.
At 3:23 PM +0100 1/20/03, Hermann Angstl wrote:

>Enable/disable validation doesn't change anything :((
>Does this really mean that the parser can't parse US-ASCII ?


Earlier version of Java did not recognize the encoding name "ASCII". 
You can try "US-ASCII" instead, but even that fails in 1.3 and 
earlier, possibly in 1.3, (I'd have to check the exact versions.) 
Best just to say "UTF-8". All ASCII documents are simultaneously 
legal UTF-8 documents.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org