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.
[#200810060201, jdk1.5.0] to reproduce: ------------- 1) create a new .jsp 2) set the encoding to UTF-16 and save it 3) set the encoding to UTF-8 and save it ERROR1: the page is saved in UTF-16 and you got message: 'Page-encoding specified in XML prolog (UTF-16BE) is different from that specified in page directive (UTF-8)' 4) remove the 'pageEncoding="UTF-16"' from <%page directive, save and close document 5) reopen it, put the 'pageEncoding="UTF-16"' atribute back and save the document ERROR2: the document starts with two BOM marks
This is caused by jsp parser returning UTF-16BE encoding for a file with UTF-16 encoding. The UTF-16 encoding has mandatory BOM, for UTF-16BE it is arbitrary. In fact both encoding are the same. Since the UTF-16BE character decoder doesn't expect BOM the BOM is written into the document content. When saving the file the BOM is added so it is duplicating. Can be fixed by not loading the BOM chars in the BaseJspEditorSupport.loadFromStreamToKit() for UTF-16BE encoding if they are present.
future=>later
NetBeans.org Migration: changing resolution from LATER to WONTFIX