This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Cannot load form after setting a JPasswordField echoChar to \u0000. Steps to reproduce: - Create a new JPanel form. - Add a JPasswordField in the Design view. - Set the password fields "echoChar" value to \u0000 in the design view - Save and Close the form - Open the form in design view again. After setting the value the form contains the following code: <Component class="javax.swing.JPasswordField" name="jPasswordField1"> <Properties> <Property name="text" type="java.lang.String" value="jPasswordField1"/> <Property name="echoChar" type="char" value="�"/> </Properties> </Component> Opening the form cannot handle the value "�".
Reassigning to form.
This error occurs in Netbeans 6.5 Beta (GUI Builder 1.2) and Netbeans 6.1 (GUI Builder 1.1.1)
Reproducible Designer correctly saved char '\u0000' into XML form file. This value is stored using unicode character entity with code in hexadecimal form. Designer throws following exception while we are trying to parse xml form file using org.openide.xml.XMLUtil.parse() ... org.xml.sax.SAXParseException: Character reference "�" is an invalid XML character. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at org.openide.xml.XMLUtil.parse(XMLUtil.java:337) at org.netbeans.modules.form.GandalfPersistenceManager.canLoadForm(GandalfPersistenceManager.java:259) at org.netbeans.modules.form.FormEditor.recognizeForm(FormEditor.java:446) All "control" codes x00-1f failed, x20-... works.
...There are certain characters that are forbidden from being in XML as per the official specification (http://www.w3.org/TR/REC-xml/#charsets). These characters are the low ascii characters such as NULL, EOF etc. Its important to note that this is not a case of unescaped/unencoded versions of this character being disallowed, the encoded characters are also disallowed. ... (http://blog.cwa.me.uk/2007/10/01/invalid-xml-from-a-net-web-service/) We should use CDDATA element or external own entity definition to save these chars into xml.