I'm trying to work with jsp "fragments" (template files) encoded in UTF-8 in NetBeans 1 outside any project 2. Please, notice that I'm talking about "jsp fragments," that is, I don't think that I can add the <%@page%> directive, as this would result in duplicated encodings directives 3 when building the final page 4.
As I have reported in NetBeans' bugzilla Bug 212395 - Cannot edit UTF-8 JSPs fragments in Favorites (not in projects), I haven't found any way to do this. Does anyone have any hint?
I have already read How do you set the encoding to utf-8 in netbeans 6.9?, How to change file encoding in NetBeans? and Saving JSP as UTF-8 in NetBeans, but the solution in all of them is based on configuring a NetBeans project that I don't have. (I open the file from the WebDAV with File -> Open File...)
The -J-Dfile.encoding=UTF-8
option does not have any effect at all, and my locale is also ignored (as expected after reading NetBean's Project Encoding vs. File Encoding - What are the precedence rules used in NetBeans 6.x?
Notes:
- NetBeans IDE 7.1.2
- The jsp files live in a mounted WebDAV filesystem
From the specs (JSR-000245 JavaServer Pages 2.1 FR):
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.
The jsp's are opencms pages that are stitched together using
<cms:include>
tags