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.
I'm using NB 3.4 under JDK 1.4.1_01 on NT4SP6a. On opening the attached file, I get the exception: Annotation: The document test [Local] could not be loaded. sun.io.MalformedInputException: Missing byte-order mark at sun.io.ByteToCharUnicode.convert(ByteToCharUnicode.java:120) at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:245) at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:295) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180) at java.io.InputStreamReader.read(InputStreamReader.java:167) at org.netbeans.editor.Analyzer.initialRead(Analyzer.java:454) at org.netbeans.editor.BaseDocument.read(BaseDocument.java:814) at org.netbeans.editor.BaseKit.read(BaseKit.java:404) at org.netbeans.modules.html.HtmlEditorSupport.loadFromStreamToKit(HtmlEditorSupport.java:143) at org.openide.text.CloneableEditorSupport.loadDocument(CloneableEditorSupport.java:1071) at org.openide.text.CloneableEditorSupport.access$1400(CloneableEditorSupport.java:101) at org.openide.text.CloneableEditorSupport$Listener.run(CloneableEditorSupport.java:1502) at org.openide.util.Task.run(Task.java:136) at org.openide.text.CloneableEditorSupport$1.run(CloneableEditorSupport.java:313) at org.openide.util.Task.run(Task.java:136) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599) Okay, so it's my own fault for including a <meta http-equiv="Content-Type" content="text/html; charset=unicode"> line when it's just plain ASCII with no extended characters (if I change the charset value to utf-8 outside of NetBeans the file then opens just fine). However, the editor ought to trap the exception and handle it better than this...
Created attachment 8642 [details] source file exhibiting problem (forgot to attach it before)
Jarda, isn't it your code?
http://html.netbeans.org/source/browse/html/src/org/netbeans/modules/html/Bundle.properties.diff?r1=1.14&r2=1.15 http://html.netbeans.org/source/browse/html/src/org/netbeans/modules/html/HtmlEditorSupport.java.diff?r1=1.6&r2=1.7 http://html.netbeans.org/source/browse/html/test/build.xml.diff?r1=1.2&r2=1.3 http://html.netbeans.org/source/browse/html/test/unit/src/org/netbeans/modules/html/EncodingTest.java.diff?r1=1.3&r2=1.4 http://html.netbeans.org/source/browse/html/test/unit/src/org/netbeans/modules/html/wrongencoding.html?rev=1.1&content-type=text/x-cvsweb-markup More user friendly message is added to annotate this case. Complete solution is to either implement fail-safe fallback or #18651 that suggests to add Encoding property where it would be possible to override encoding found in file.