This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "encoding problem" Watch "encoding problem" New topic
Author

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

Firefox:

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


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


IE7:
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..
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41017
    
  43
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" ...


Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: encoding problem
 
Similar Threads
Character Encoding in Servlet
How to force encoding of web browser to UTF-8
Error Validating huge XSD with XML in a Servlet
Problems with Charset
Post request doesnot support spanish characters in case of Weblogic + Solaris combination