File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes encoding problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "encoding problem" Watch "encoding problem" New topic

encoding problem

baran tamer
Ranch Hand

Joined: Jan 22, 2009
Posts: 33
I used a code to determine the request and response encodings, this way i thought i could solve the encoding problem. But the problem got really weird

i used the above code in a file and below are the results in Firefox , opera and internet explorer 7 for the same file


Request Encoding: [UTF-8 ]
Response Encoding: [UTF-8 ]

Request Encoding: [UTF-8 ]
Response Encoding: [UTF-8 ]

Request Encoding: [ISO-8859-1 ]
Response Encoding: [UTF-8 ]

Firefox and Opera works fine (Shows the turkish characters) but ie7 behaves different(wrong). I have no idea why,any idea would be appreciated..
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
What is the connection between the request encoding and showing characters? The way characters are displayed depends on the response encoding, which seems to be correct.

Or is what you're displaying submitted in a form as part of the request? If so, make sure that the page that contains the form is sent as UTF-8. Browser generally use the form page's encoding as the encoding for sending form submits.

In addition, add this to your FORM tag:
<form ... accept-charset="UTF-8" ...
I agree. Here's the link:
subject: encoding problem
It's not a secret anymore!