aspose file tools*
The moose likes Struts and the fly likes How to force encoding of web browser to UTF-8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to force encoding of web browser to UTF-8" Watch "How to force encoding of web browser to UTF-8" New topic
Author

How to force encoding of web browser to UTF-8

Ngo Hoang Minh
Greenhorn

Joined: Apr 26, 2007
Posts: 2
Dear all,

I used tiles of Struts 1.1 and WebSphere. How I force encoding of browser to UTF-8 ? I used an filter to set content type of response to "text/html; charset=UTF-8" - response.setContentType("text/html; charset=UTF-8")
I also set character encoding of request to "UTF-8" - request.setCharacterEncoding("UTF-8") in this filter
I also set <meta http-equiv="content-type" content="text/html; charset=utf-8" /> at template JSP file

but when I run my application, the encoding of web browser (both IE and Fire Fox) did not force to UTF-8

Please help me

Best regards,
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
In the top of your JSP:

 
Don't get me started about those stupid light bulbs.
 
subject: How to force encoding of web browser to UTF-8