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 38053 - EDITOR: Invalid contentType charset vs. save action
Summary: EDITOR: Invalid contentType charset vs. save action
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 3.x
Hardware: PC All
: P1 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 40632 40731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-12 15:22 UTC by David Kaspar
Modified: 2004-07-07 15:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception (2.48 KB, text/plain)
2003-12-12 15:22 UTC, David Kaspar
Details
ide.log (25.06 KB, text/plain)
2004-03-01 12:33 UTC, vanob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kaspar 2003-12-12 15:22:01 UTC
How to reproduce:
1) Create JSP file
2) Type following line:
<%@page contentType="text/html; charset=ISO-8859-2;"%>
3) Save file using Ctrl+S
4) ERROR -
java.nio.charset.IllegalCharsetNameException is
shown in exception dialog - see attachment
Comment 1 David Kaspar 2003-12-12 15:22:52 UTC
Created attachment 12552 [details]
Exception
Comment 2 Petr Pisl 2004-02-03 13:38:35 UTC
Already fixed in the trunk.
Comment 3 vanob 2004-03-01 12:31:24 UTC
I'm using NetBeans 3.6 qbuild version 200402251620
same steps.

interesting thing is that the file is saved without an
exception dialog on the second try.

attatching ide.log for more investigation
Comment 4 vanob 2004-03-01 12:33:44 UTC
Created attachment 13739 [details]
ide.log
Comment 5 Petr Pisl 2004-03-01 13:27:14 UTC
I didn't catch the ';' in the "charset=ISO-8859-2;". The parser
returns encoding "ISO-8859-2;". I'm going to fix it.
Comment 6 Petr Pisl 2004-03-01 13:28:43 UTC
*** Issue 40632 has been marked as a duplicate of this issue. ***
Comment 7 Petr Pisl 2004-03-01 14:03:21 UTC
The fix is in the trunk.
There is catch for the exception and if this exception occurs, the
information dialog is shown.
Comment 9 vanob 2004-03-02 05:30:23 UTC
The dialog is shown as an ordinary exception within the ide.
I think there must be some informative message about it.
And also could you verify that
http://www.netbeans.org/issues/show_bug.cgi?id=40632
is fixed also?
Comment 10 Petr Pisl 2004-03-02 10:42:00 UTC
The fix brings the dialog, which informs user about bad encoding and
asks him, whether he wants to save it in UTF-8. You can see it in
todays builds.

The issue 40632, is consequence of this bug. It should not occur now.
So I'm not going to fix it, because it is not valid. 
Comment 11 Martin Schovanek 2004-03-02 14:29:37 UTC
Still reproducible:

1) perform steps 1 - 4 from original 'How to reproduce'.

ERROR: The editor didn't trim trailing ';' and displays warning: 'The
"ISO-8859-2;" character set that is used in index.jsp is not valid
character set .... Did you want to save the file using the UTF-8
character set?'

2) press 'Yes' button

ERROR: java.nio.charset.IllegalCharsetNameException is
shown in exception dialog.

NOTE: Question dialog 'File index.jsp was modified externally. Reload
it?' appears at the same time. 

3) press 'Yes' button

ERROR: All document text is deleted and Undo button is disabled.
Reproducible data lost -> P1.
Comment 12 Petr Pisl 2004-03-02 15:14:40 UTC
I agree with you Martin, this is P1. I committed the fix in the main
trunk. See
http://web.netbeans.org/source/browse/web/core/src/org/netbeans/modules/web/core/jsploader/BaseJspEditorSupport.java.diff?r1=1.27&r2=1.28
Comment 13 Martin Schovanek 2004-03-03 16:19:06 UTC
Reviewed by QE. The fix is fine.
Comment 14 Martin Grebac 2004-03-04 09:12:13 UTC
Reviewed. Looks fine.
Comment 15 Petr Pisl 2004-03-04 10:45:41 UTC
Committed in to release36 branch as well.
Comment 16 Petr Pisl 2004-03-09 14:41:24 UTC
*** Issue 40731 has been marked as a duplicate of this issue. ***
Comment 17 Martin Schovanek 2004-07-07 15:52:46 UTC
V