Opened 14 years ago

Closed 14 years ago

#1514 closed defect (fixed)

Fix character encoding of jsp files

Reported by: Nicklas Nordborg Owned by: everyone
Priority: critical Milestone: BASE 2.16
Component: web Version:
Keywords: Cc:

Description

It seems like the change to UTF-8 encoding made in #1290 was not correct for JSP files. They were checked in as ISO-8859-1 files. Since then, Eclipse has messed things up when editing since it expected the files to be in UTF-8 format. This mostly affects the Häkkinen in the license header, but there is also a problem with the list_reporters.jsp which makes it impossible to filter on reporters on a reporter list:

InvalidDataException: Property '�reporterListScores' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.

I guess we have to check all JSP files for invalid characters.

Change History (4)

comment:1 by Nicklas Nordborg, 14 years ago

(In [5425]) References #1514: Fix character encoding of jsp files

I hope this fixes most of the issues, including the reporter list filtering in many places. Let's keep an eye open for more issues until it is time to release 2.16

comment:2 by Nicklas Nordborg, 14 years ago

I have been reading up a bit on this. The default encoding for a jsp page is supposed to be ISO-8859-1, unless the pageEncoding attribute is specified:

<%@ page pageEncoding="UTF-8" ...

But it is also possible to set the default encoding in the web.xml file:

<jsp-config>
   <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <page-encoding>UTF-8</page-encoding>
   </jsp-property-group>
</jsp-config>

We are using the second option in BASE but the problem is that Eclipse doesn't pick this up automatically and loads every JSP file with ISO-8859-1 encoding. That is probably why the change in #1290 failed.

It is possible to reconfigure this by going to Window->Preferences->General->Content types->Text->JSP.

I guess it would be better to put the pageEncoding attribute in every JSP file since it will automatically get picked up by Eclipse and there is no risk of forgetting to change the encoding if Eclipse is reinstalled.

comment:3 by Nicklas Nordborg, 14 years ago

(In [5426]) References #1514: Fix character encoding of jsp files

  • Add pageEncoding="UTF-8" to all JSP files.
  • Add @charset="UTF-8"; to all CSS files.
  • Add charset="UTF-8" to all <script> tags

This should at least make Eclipse happy and hopefully allow other editors to automatically select the correct encoding.

comment:4 by Nicklas Nordborg, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.