websphere上的字符编码问题 [英] Character encoding issues on websphere

查看:221
本文介绍了websphere上的字符编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个应用程序服务器(websphere 8.0.0.3)中部署的应用程序的以下问题。

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

这些服务具有相同的配置文件我导出一个配置文件,并将其导入到第三个应用程序服务器,以确保),我在阅读和显示文件编码iso8859-7的问题。一个应用程序服务器正确显示它们,其他显示其中非ASCII字符在文件中的qustionmarks。其他应用程序服务器在正确显示它们时没有问题。因为我怀疑这个问题不是源于websphere,它是一个操作系统问题(unix SLES在所有情况下)我已经导出配置文件从一个sevrer,并安装在第三个,似乎只是工作罚款。

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.

尝试解决这个问题,我部署了一个简单的servlet,显示jvm的默认字符集。有问题的是显示US-ASCII和好的一个显示UTF-8。作为运行应用程序服务器的用户在UNIX终端中运行区域设置,在两台计算机的en_US.UTF8上设置lang。

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.

我想添加的最后一件事,是应用程序还使用slf4j与log4j绑定写入日志文件。在有问题的服务器上,日志文件是ASCII,并且好的是UTF-8。因为在日志中明显记录iso8859-7字符,显示问号(?)而不是实际字符。

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.

我的问题是我是否应该继续寻找mis-

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

提前感谢您

Vasileios Mylnakis

Vasileios Mylnakis

推荐答案

websphere是否在不同的操作系统上运行?

Is the websphere ran on difference operating system ?

您可以通过添加这些JVM参数强制WebSphere使用UTF-8

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

这篇关于websphere上的字符编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆