hi i have a webapp in jsp
on an old tomcat entering my webapp ,the browser automaticly detect UTF-8
but when starting the same webapp in a fresh tomcat5.5, browser wont detect UTF-8 ,i have to change it manually
(i am hosting my app now ,and i want it to work properly on a fresh tomcat)
tried to
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
response.setHeader("Content-Encoding","UTF-8");
but not helping , in some cases when i am trying to change to UTF-8 i still see jibrish
my jsp file i saved as UTF-8 and in meta i have this
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
also in server.xml i define this under the Connector
URIEncoding="UTF-8"
--
开发者_如何转开发can u help me please ?
Assuming you've still got the old app working, and you've got a (preferably simple) page that both servers can serve, I suggest you use Wireshark or Fiddler to see exactly what's being sent back. Then you can work out the difference, and make the new server work the same way.
As Ignacio says, it may be that you're simply not serving UTF-8, however much you're trying to tell the client that you are :)
精彩评论