R bhushanam

Greenhorn
+ Follow
since Jul 17, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by R bhushanam

Originally posted by Jarno Walgemoed:
Hi all,

This question might have been asked before, but I'm going to ask it anyway because I'm completely puzzled by how this works in JSF.

Let's begin with the basics, I have an application running on an OC4J servlet container, and am using JSF 1.1 (MyFaces). The problems I am having with this setup, is that it seems that the character encodings I want the server/client to use are not coming across correctly. I'm trying to enforce the application to be UTF-8, but after the response is rendered to my client, I've magically been reverted to ISO-8859-1, which is the main character set for the netherlands. However, I'm building the application to support proper internationalization; which means I NEED to use UTF-8.

I've executed the following steps to reach this goal:

- All JSP files contain page directives, noting the character set:




I've checked the generated source that comes from the JSP's, it looks as expected.

- I've created a servlet filter to set the character set directly on the request and response objects:




I've debugged the code, and this works fine, except for where JSF comes in. If I use the above situation, without going through JSF, my pages come back UTF-8. When I go through JSF, my pages come back as ISO-8859-1. I'm baffled as to what is causing this. On several forums, writing a filter was proposed as the solution, however this doesn't do it for me.

It looks like somewhere internally in JSF the character set is changed to ISO. I've been through the sources, and I've found several pieces of code that support that theory. I've seen portions of code where the character set for the response is set to that of the request. Which in my case coming from a dutch system, will be ISO.

How can this be prevented? Can anyone give some good insight on the inner workings of JSF with regards to character sets in specific? Could this be a servlet container problem?

Many thanks in advance for your assistance,

Jarno




hi Jarno ,

Can you please tell me the solution for the same issue. I am also getting the same problem. I have the environment JSF1.1, oc4j904 container, in filter servlet added the servletRequest.setCharacterEncoding("UTF-8");
First time it's coverting to UTF-8, But from second time encoding to ISO-8859-1.



Thanks & regards
bhushanam.
17 years ago
JSF