Created attachment 119359 [details]
Netbeans incorrect Windows-1252 presentation of a UTF-8 jsp fragment
When editing files in the filesystem outside any project, there is no way to tell NetBeans what the correct encoding of the file is.
NetBeans get it even wronger, as it reports "XXX"
I'm working with template files from a mounted WebDAV filesystem. The templates have "jsp" extension, and I cannot add the page-pageEncoding directive, as they are only fragments that will be stiched together.
Creating a project for small edits is a no-go: the WebDAV interface is very slow, the directory content is huge, and the server requires too many resources.
1. Create an UTF-8 jsp fragment in your filesystem, _out of any of the existing projects_. Preferible with the BOM, so the problem stands out.
2. Open it with File-> Open File...
3. The file starts with the "ï»¿" Windows-1252 representation of the BOM
The file should be detected as ISO-8859-1 (http://wiki.netbeans.org/DevFaqI18nFileEncodingQueryObject).
It should be possible to force the encoding of the file to UTF-8.
Sorry, "XXX" stands for <<Using "windows-1252" instead of the declared encoding "iso-8859-1">>
I have checked the JSP specs and am changing the issue type to "enhancement," as it should be possible to add a "pageEncoding" per file, even if these files are being included into a final one (translation unit). I still would prefer to have an option through the IDE to set the encoding per directory, without the need of adding this directive:
"A translation unit [...] can contain more than one instance of the page directive. [...] There shall be only one occurrence of any attribute/
value pair defined by this directive in a given translation unit. [...] The import and pageEncoding attributes are exempt from this rule and can appear multiple times.[...] The pageEncoding attribute can occur at most once per file (or a translation error will result), and applies only to the file in which it appears." [JavaServer PagesTM Specification Version 2.1, JSP.1.10.1 The page Directive]
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.
Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Re-tested with NetBeans 8.1: I can confirm that this issue is not reproducible.