UTF-8 has become dominant character encoding for the web applications.
In this article, I will talk about how to configure UTF-8 in IBM WAS, Oracle Weblogic, Tomcat, TC Server & JBoss.
WebSphere Application Server
- Login into WebSphere Administrative Console
- Expand Servers >> Application Servers
- Click on Application Server (JVM) you want to enable UTF-8
- Expand Java and Process Management under Server Infrastructure
- Click on Process Definition
- Click on Java Virtual Machine
- Add the following parameter in Generic Java Arguments
-Dclient.encoding.override=UTF-8
- Click Ok, Sync the node if applicable
- Restart Application Server (JVM) for changes to take effect.
Oracle WebLogic Server
- Go to Weblogic Domain path
- Go to bin folder
- Add following parameter in setDomainEnv.sh under
JAVA_OPTS
variable.
-Dfile.encoding=utf8
- Restart Weblogic server for changes to take effect.
Tomcat
- Go to tomcat home (installation) folder
- Go to conf folder
- Add the following parameter in
server.xml
under Connector port.
URIEncoding="UTF-8"
Note: if you have multiple Connector ports, you must add them under all.
- Go to tomcat home (installation folder)
- Go to bin folder
- Add the following parameter in catalina.sh under
JAVA_OPTS
variable.
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
Ex:
JAVA_OPTS=”-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8”
- Restart Tomcat Server for changes to take effect.
TC Server
- Go to TC Server instance folder
- Go to conf folder
- Add the following parameter in server.xml under Connector port.
URIEncoding="UTF-8"
- Go to TC Server instance folder
- Go to bin folder
- Add following in setenv.sh under CATALINA_OPTS variable
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
Ex:
CATALINA_OPTS="-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"
- Restart TC Server for changes to take effect.
JBoss Application Server
- Go to JBoss installation path
- Go to bin folder
- Add the following parameter in standalone.conf under JAVA_OPTS
-Dfile.encoding=UTF-8
- Restart JBoss Server for changes to take effect.
UTF-8 Validation Tools
You can use following online tool to validate if your web application is UTF-8 supported
http://coderstoolbox.net/string/
I hope above instructions help you in configuring UTF-8 in multiple application servers.
If you are looking to enhance skills in Oracle Weblogic administration, then check out this course by Chris Parent.