简体   繁体   中英

Character encoding issue related with currency symbols

I am creating a web application.I am using linux(fedora 16) for the development of the application and technology used is spring MVC.Its a maven project.When I run application in debug environment the application works fine and its displaying special characters properly.EgI want to display currency symbol pound(₤) its displaying properly. But if I deploy the application on tomcat 6.0.26 or 6.0.35 on windows machine then it is not displaying currency symbols properly.Egit show pound sign as "£".So can anyone having idea about this issue.

In your tomcat server's catalina.sh (catalina.bat) add the args like this;

   set JAVA_OPTS=-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8

and also set URIEncoding="UTF-8" on your Connector tag in server.xml. see this;

   <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" URIEncoding="UTF-8"/>

What you want is to use a CharacterEncodingFilter . I recommend reading the entire FAQ that link points to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM