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.

Bug 30253 - sun.io.MalformedInputException on opening HTML file containing charset=unicode
Summary: sun.io.MalformedInputException on opening HTML file containing charset=unicode
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: _ rkubacki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-21 18:40 UTC by ats37
Modified: 2009-05-18 10:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
source file exhibiting problem (forgot to attach it before) (364 bytes, text/html)
2003-01-22 12:18 UTC, ats37
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ats37 2003-01-21 18:40:09 UTC
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...
Comment 1 ats37 2003-01-22 12:18:07 UTC
Created attachment 8642 [details]
source file exhibiting problem (forgot to attach it before)
Comment 2 _ rkubacki 2003-01-24 16:21:39 UTC
Jarda, isn't it your code?