Disable coding warning for templates in Netbeans 7.2

I often work with template files in Netbeans 7.2: In TYPO3 with HTML and Fluid-based templates; in OXID eSales, with Smarty templates.

If the template file contains the charset variable, as shown below, Netbeans will warn you every time you open or save the file.
<meta http-equiv="Content-Type" content="text/html; charset=[{$oView->getCharSet()}]">

A warning:

 The encoding [{$oView->getCharSet()}] specified in meta tag of the document base.tpl is invalid. Do you want to load the file using UTF-8 encoding? [Yes] [No] 

How can I disable this?
(As a workaround, I usually replace [{$oView->getCharSet()}] with utf-8 , but it's ugly.)

+4
source share
2 answers

HTML validation alerts can be customized to some extent using Netbeans hints . I could not verify this (since I do not have the latest version), but maybe you can check the latest build if the IDE version does not provide the ability to disable the warning.

Go to Tools -> Options -> Editor -> Hints -> HTML Validator

Build 7.1 onwards in Netbeans a new category called Encoding added. I think you will probably find the option to enable / disable the tooltip that controls this HTML warning.

References:
Warning about incorrect encoding in HTML files
Not the exact error you encounter, but it refers to the corresponding validation hints:

There are several new hints for the HTML language in the editor options. There are three new subcategories of the Html Validator category - Encoding issues, tags, compliance issues, and others.

HTML Hints in Netbeans

+1
source

I tried this on 7.1 and 7.0.1 and got the same results. It seems that changing the encoding of the encoding does not work until restarting NetBeans.

 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 <!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> 
  • Change "UTF-8" to "Shift_JIS" or another type encoding

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

    The yellow line is displayed on the line and it complains

    A warning. The declaration of the internal encoding "euc-jp" is not consistent with the actual encoding of the document ("utf-8"). From row 9, column 9; to line 9, column 76 (Rule category: all others) newhtml.html
    / home / mkatakai / NetBeansProjects / WebApplication 7 / web / newhtml.html: 9

  • Open the file property, it still says “UTF-8” (screenshot)

  • close the file and open it again, a warning is still displayed, the project file dialog still says that UTF-8
  • close the project and reopen it, however the warning is still displayed, the file project dialog still says UTF-8
  • exit NetBeans and run it again, finally the warning disapper and the Project Dialog says EUC-JP (screenshot)
0
source

All Articles