Bug 2998 - SAXParseException: The encoding "Cp1252" is not supported.
Summary: SAXParseException: The encoding "Cp1252" is not supported.
Status: RESOLVED INVALID
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: SAX (show other bugs)
Version: 1.4.2
Hardware: PC other
: P3 blocker
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-08-06 01:16 UTC by Laurent Thil
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Thil 2001-08-06 01:16:59 UTC
Developping under JBuilder4, Tomcat 3.2.3, Apache Soap 2.2 and Xerces 1.4.2
JBuilder built a configuration file for Tomcat "server.xml". Developping under 
WinNT, the encoding in this xml file is set to "Cp1252". As I have configure 
Tomcat to use the Xerces parser, it uses this one to decode the config file 
where it gives the fault:

D:\JBuilder4\jdk1.3\bin\javaw -classpath "D:\JBuilder4\xerces-1_4_2
\tools\xerces.jar;D:\JBuilder4\soap-2_2\lib\soap.jar;D:\JBuilder4\javamail-1.2
\mail.jar;D:\JBuilder4\jaf-1.0.1\activation.jar;D:\JBuilder4
\tomcat\lib\jaxp.jar;D:\JBuilder4\tomcat\lib\parser.jar;D:\JBuilder4
\tomcat\lib\webserver.jar;D:\JBuilder4\tomcat\lib\jasper.jar;D:\JBuilder4
\lib\servlet.jar;D:\JBuilder4
\lib\webserverglue.jar;D:\DavinciProject\classes;D:\JBuilder4
\lib\servlet.jar;D:\JBuilder4\lib\jbcl.jar;D:\JBuilder4\jdk1.3
\demo\jfc\Java2D\Java2Demo.jar;D:\JBuilder4\jdk1.3\jre\lib\i18n.jar;D:\JBuilder4
\jdk1.3\jre\lib\jaws.jar;D:\JBuilder4\jdk1.3\jre\lib\rt.jar;D:\JBuilder4\jdk1.3
\jre\lib\sunrsasign.jar;D:\JBuilder4\jdk1.3\lib\dt.jar;D:\JBuilder4\jdk1.3
\lib\tools.jar"    org.apache.tomcat.startup.Tomcat -config 
D:\DavinciProject\conf\server8080.xml
ERROR reading D:\DavinciProject\conf\server8080.xml

At The encoding "Cp1252" is not supported.



FATAL: configuration error

org.xml.sax.SAXParseException: The encoding "Cp1252" is not supported.

	at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969)

	at 
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument
(DefaultEntityHandler.java:541)

	at org.apache.xerces.framework.XMLParser.parseSomeSetup
(XMLParser.java:303)

	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:860)

	at javax.xml.parsers.SAXParser.parse(SAXParser.java:211)

	at javax.xml.parsers.SAXParser.parse(SAXParser.java:181)

	at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:214)

	at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:187)

	at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)

But looking at the Xerces 1.4.1, this encoding should be supported. The 
behaviour is the same for 1.4.1 and 1.4.2

Any Ideas ?

Laurent
Comment 1 Glenn Marcy 2001-08-06 06:17:47 UTC
> But looking at the Xerces 1.4.1, this encoding should be supported.

Yes, under the encoding name "WINDOWS-1252".  The name "Cp1252" is the
name of this encoding for the Java JDK and is not a portable encoding
for use in XML documents (there are non-Java XML processors after all).

While it is not recommended, you could also set the feature:

   http://apache.org/xml/features/allow-java-encodings

but your document would not be portable.