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.
HTML is now opened and saved in ide editor using system locale for the page encoding. If meta tag has been specified in html file, editor open and save using CHARSET value of meta tag, but there is no way to specify the page encoding for html without meta tag. There are not a few case that user wants to create html without meta tag as using include directive in jsp. This issue occurs to open and save with different encoding in ide editor between html with meta tag and html with no meta tag. User needs the way to set page encoding for html and avoid obstruction for handling of multibyte char contents on ide editor.
I suggest to have here a property, which should be read only, when the html file has meta tag with encoding. When there is not this meta tag, then the property should be read write.
This is still open question. It should be solved in one way for other files as well.
I vote for this.
when i set <%@ page contentType="text/html; charset=GBK" isErrorPage="true" %> it initially works fine But later the file's encoding set to ISO-8859-1, it ignore "charset=GBK".
Hi Truncatei, Encoding of jsp files is obtained different way. The encoding of jsp file is taken from jsp parser and can be influenced with deployment descriptor. Can you fill a separate defect for this and describe how to reproduce? Thanks
I'm waiting for general apprach in the ide, how to handle encoding.
NetBeans 6.0 introduce FileEncodingQuery and now the ide works with the html file without the metatags in encoding which is setup for the project. We are not going to introduce a property for the HTML files.
Sounds reasonable. But i guess the meta tag will have still priority, and will also work for files opened outside any project (through Favorites). At least it should, IMHO.
You can imagine the FileEncodingQuery functionality as layers with priorities. If a layer with higher priority is not able to recognize encoding of the file, then returns null and the layer with lower priority is asked for the encoding for the file. The layers are: P1 FEQImplementation for the html file which looks into the html file and try to find the meta tag. There is metatag -> returns the encoding else null P2 FEQImplementation for the project. If the file is in a project returns project encoding, else null. It works in Favourite view as well. P3 FEQImplementation for the system. It returns the default encoding of the virtual machine. Always returns an encoding.
Sounds good. BTW it looks like very good example of Chain of Responsibility design pattern :)