Encoding of ADF Faces Pages


I got several issues this week that had the same root cause though the symptoms were completely different.

The problem is related to the page encoding of the ADF Faces JSPX.
ADF Faces supports 'utf-8' only.
However, by default, the editor creates the pages with the 'windows-1252' encoding:

Windows1252.png

This leads to problems like:

  • accented characters transformed to code representation during the Submit - see the discussion "Character encoding problem in ADF 11 app" in the OTN Forum
  • Error: "The value is not a number" when using groupingUsed="true" with specific locale (French f.ex.)
  • ...

To avoid these issues, you can edit your pages and change 'windows-1252' by 'utf-8'.
For the new pages, you can change the default to 'utf-8':

  1. select menu "Tools" -> "Preferences..."
  2. click "Environment"
  3. select "UTF-8" in the "Encoding" list.


Encoding.png


The new pages will be created correctly now.
Note that as from JDeveloper 11.1.1.2.0 onwards, JDeveloper will use the encoding 'utf-8' (whatever the default encoding is) when ADF Faces technology is used.

Comments:

To fix existing pages, would it be as simple as replacing "windows-1252" with "UTF-8" in all jspx files?

Posted by M Sime on September 21, 2009 at 06:28 AM CEST #

Yes - correct. The preference will only apply to the new pages you create after you changed the default encoding there - not the pages that were created before. For these, you can just replace the string "windows-1252" with "utf-8". Regards, Didier.

Posted by Didier on September 21, 2009 at 07:37 AM CEST #

Post a Comment:
Comments are closed for this entry.
About

Didier Laurent - Sr Principal Support Engineer in the JDeveloper team

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today