Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 212395 - Cannot edit UTF-8 JSPs fragments in Favorites (not in projects)
Cannot edit UTF-8 JSPs fragments in Favorites (not in projects)
Product: javaee
Classification: Unclassified
Component: JSP Parser
PC Linux
: P3 (vote)
Assigned To: issues@javaee
Depends on:
  Show dependency treegraph
Reported: 2012-05-11 14:53 UTC by agallardo
Modified: 2016-07-08 07:45 UTC (History)
1 user (show)

See Also:

Netbeans incorrect Windows-1252 presentation of a UTF-8 jsp fragment (47.49 KB, image/png)
2012-05-11 14:53 UTC, agallardo

Note You need to log in before you can comment on or make changes to this bug.
Description agallardo 2012-05-11 14:53:32 UTC
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.

To reproduce:

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 (
It should be possible to force the encoding of the file to UTF-8.
Comment 1 agallardo 2012-05-11 14:57:57 UTC
Sorry, "XXX" stands for  <<Using "windows-1252" instead of the declared encoding "iso-8859-1">>
Comment 2 agallardo 2012-05-11 18:30:40 UTC
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]
Comment 3 Martin Balin 2016-07-07 08:54:18 UTC
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
Comment 4 agallardo 2016-07-08 07:45:44 UTC
Re-tested with NetBeans 8.1: I can confirm that this issue is not reproducible.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo