namalfernandolk
namalfernandolk

Reputation: 9134

Defining accent characters in different platforms under java

I have a problem with the accent character in different platforms.

When I log this in my machine under fedora (where default charset is UTF-8) it is printing correvtly as Sacré Coeur.

But when i update to another server that is running on RedHat (where default charset is ISO-8859-1), it is printing as Sacré Coeur.

I want to log it in RedHat server as same as in my my Fedora machine. How can I do this?

My Workout :

Upvotes: 0

Views: 428

Answers (1)

Supun Sameera
Supun Sameera

Reputation: 2703

To get similar out put from all the environments, with out depending on the server OS default character encoding, when you start your program or the server environment (Jboss tomcat or jetty) pass -Dfile.encoding to the start-up script

(lets say run.sh in jboss, add -Dfile.encoding=UTF-8 to JAVA_OPTS)

-Dfile.encoding=UTF-8

Upvotes: 1

Related Questions