0

I tried configuring the charset to UTF-8 in my JBoss 4 but I was unable to do that successfully.
There is a requirement to accept arabic characters in my application.
Although I know this could be achieved through direct encoding in jsp, I want to try doing that through configuration in JBoss.

I tried the below in server.xml but in vain.

<Connector .... URIEncoding="UTF-8" ....  />

Subsequently changed the run.bat file

JAVA_OPTS=-Dfile.encoding=utf-8 %JAVA_OPTS%

the above change in the run.bat file collapsed the whole server.

Is there any workaround to set the encoding to UTF-8 directly in the server rather than through JSP? The end result is that my application should allow arabic characters.

Freakyuser
  • 2,774
  • 17
  • 45
  • 72
  • Take a look in this question http://stackoverflow.com/questions/6336923/how-can-i-cleanly-set-the-pageencoding-of-all-my-jsps maybe can help you. – Federico Sierra Dec 02 '14 at 15:14

1 Answers1

0

This answer may be a bit late. But I will post it anyway. I just fixed similar issue on Ubuntu & CentOS and I just stumbled upon this question while I was skimming through this site.

From the JVM™ Tool Interface documentation…

Since the command-line cannot always be accessed or modified, for example in embedded VMs or simply VMs launched deep within scripts, a JAVA_TOOL_OPTIONS variable is provided so that agents may be launched in these cases.

By setting the (Windows) environment variable JAVA_TOOL_OPTIONS to -Dfile.encoding=UTF8, the (Java) System property will be set automatically every time a JVM is started. You will know that the parameter has been picked up because the following message will be posted to System.err:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

Please refer to this question for more details.

In order make the same setting in a linux environment assign it in run.sh and .bashrc to ensure that UTF-8 encoding will used by the JVM at all times.

Set Encoding in .bashrc, set the following: export LC_ALL=en_US.UTF-8
Set in Run.sh JAVA_OPTS section : JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
Community
  • 1
  • 1
Gehan
  • 380
  • 4
  • 17