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 41053 - I18N - No feature for HTML to specify page encoding without meta tag
Summary: I18N - No feature for HTML to specify page encoding without meta tag
Status: RESOLVED WONTFIX
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2004-03-17 05:17 UTC by mtsuruta
Modified: 2009-05-18 10:45 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mtsuruta 2004-03-17 05:17:13 UTC
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.
Comment 1 Petr Pisl 2004-03-31 14:34:58 UTC
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. 
Comment 2 Petr Pisl 2004-09-22 16:44:45 UTC
This is still open question. It should be solved in one way for other
files as well. 
Comment 3 nguyenq 2004-11-26 01:32:16 UTC
I vote for this.
Comment 4 Truncatei 2005-03-02 02:04:48 UTC
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".
Comment 5 Petr Pisl 2005-03-02 07:34:16 UTC
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
Comment 6 Petr Pisl 2005-11-10 14:42:30 UTC
I'm waiting for general apprach in the ide, how to handle encoding.
Comment 7 Petr Pisl 2007-10-16 13:42:46 UTC
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. 
Comment 8 gborkowski 2007-10-16 13:50:46 UTC
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. 
Comment 9 Petr Pisl 2007-10-16 15:23:05 UTC
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. 
Comment 10 gborkowski 2007-10-16 15:28:06 UTC
Sounds good.
BTW it looks like very good example of Chain of Responsibility design pattern :)