« "Oracle Java Development Community" on "My Oracle Support" | Main | ClassNotFound: How To Find The Missing Library »

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.

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/14066

Comments (2)

M Sime:

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

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.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on September 17, 2009 10:03 AM.

The previous post in this blog was "Oracle Java Development Community" on "My Oracle Support".

The next post in this blog is ClassNotFound: How To Find The Missing Library.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle