Character encoding issues on websphere

蹲街弑〆低调 提交于 2019-12-21 17:26:05

问题


I have the following issue concerning the application I have deployed in two application servers (websphere 8.0.0.3).

These serves have identical configuration file (at one point I exported the one configuration file and imported it to a third application server just to be sure) and I am having issues in reading and displaying files encoded in iso8859-7. One application server displays them correctly the other displays qustionmarks where a non ascii character is in the file. The other application server does not have a problem in displaying them correctly. Since as I am suspecting that the problem does not originate from the websphere, and it is a OS problem (unix SLES in all cases) I have exported the configuration file from one sevrer and installed it on a third one and all seems to work just fine.

Trying to solve the issue I have deployed a simple servlet displaying the default charset of the the jvm. On the problematic is displayed US-ASCII and on the good one displays UTF-8 . Running locale in an unix terminal as the user running the application server, lang is set on en_US.UTF8 on both machines.

A final thing that I would like to add, is that the application also writes log files using slf4j with log4j binding. On the problematic server the log file is ASCII and on the good one is UTF-8. As it is obvious logging iso8859-7 chars in the log, displays questionmarks (?) instead of the actual character.

My question is whether I should keep looking for mis-configuration problems in the websphere or it is a problem of the operating system setup

Thank you in advance

Vasileios Mylnakis


回答1:


Is the websphere ran on difference operating system ?

you can force WebSphere to use UTF-8 by adding these JVM Arguments

-Dclient.encoding.override=UTF-8
-Dfile.encoding=UTF-8

ref:

http://www-01.ibm.com/support/docview.wss?uid=nas8N1014138 http://www-01.ibm.com/support/docview.wss?uid=swg21593033



来源:https://stackoverflow.com/questions/18188694/character-encoding-issues-on-websphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!