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 206559

Summary: I18N: changing HTML charset encoding does not work until restart of NetBeans
Product: web Reporter: Masaki Katakai <masaki>
Component: HTML EditorAssignee: Milutin Kristofic <mkristofic>
Status: NEW ---    
Severity: normal CC: kalle1
Priority: P3 Keywords: I18N
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: NetBeans shows warning euc-jp is not correct just after changing source code
after restarting NetBeans, the warning disappeared and property dialog also says it's EUC-JP

Description Masaki Katakai 2011-12-20 00:42:36 UTC
I tried this on both 7.1 and 7.0.1 and got the same results. It seems that
changing charset encoding does not work until NetBeans is restarted.

1. Start NetBeans
2. Create a project by default
    It means project encoding is set to "UTF-8" by default

3. Create a HTML file from File>New File... and Other>HTML File
    The project encoding is set to UTF-8, so created file also should be UTF-8 encoding. -> OK

<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <div>TODO write content</div>
    </body>
</html>

4. Modify "UTF-8" to "Shift_JIS" or other encoding like

        <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">

        <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">

    Yellow line is displayed on the line and it complains

     Warning	Internal encoding declaration "euc-jp" disagrees with the actual encoding of the document ("utf-8"). From line 9, column 9; to line 9, column 76 (Rule Category: All Other)	newhtml.html	/home/mkatakai/NetBeansProjects/WebApplication7/web/newhtml.html:9

5. Open propery of the file, it still says "UTF-8" (screenshot)
6. close the file and open it again, the warning is still displayed, project dialog of the file is still saying it's UTF-8
7. close the project and open it again, however, the warning is still displayed, project dialog of the file is still saying it's UTF-8
8. quit NetBeans and start it again, finally the warning disapper and project dialog says it's EUC-JP (screenshot)
Comment 1 Masaki Katakai 2011-12-20 00:44:25 UTC
Created attachment 114331 [details]
NetBeans shows warning euc-jp is not correct just after changing source code
Comment 2 Masaki Katakai 2011-12-20 00:44:56 UTC
Created attachment 114332 [details]
after restarting NetBeans, the warning disappeared and property dialog also says it's EUC-JP
Comment 3 Marek Fukala 2012-04-23 12:54:03 UTC
reproducible
Comment 4 Milutin Kristofic 2015-08-04 15:11:35 UTC
*** Bug 254015 has been marked as a duplicate of this bug. ***