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

问题描述

我遇到码头字符编码问题.在Mac(OSX)上安装码头服务器时,它可以正常工作.但是,当它安装在Ubuntu(10.10)上时,字符编码不正确.

I am facing a problem with jetty character encoding. When installed the jetty server on Mac (OSX), it works fine. But, when it is installed on Ubuntu (10.10), the character encoding is not proper.

页面(不是URL)中出现问题的单词是:《纽约时报》畅销书

The word in the page (not URL) having problem is: The New York Times® Bestsellers

在Linux上服务器所服务的页面上,该页面显示为纽约时报》畅销书

It is shown as "The New York Times� Bestsellers" on the page served by the server on Linux

它在Mac上服务器所服务的页面上显示为纽约时报®畅销书"(这是正确的)

and it is shown as "The New York Times® Bestsellers" on the page served by the server on Mac (This is correct)

码头服务器版本为:hightide-7.0.2.v20100331

The jetty server version is: hightide-7.0.2.v20100331

所提供文件的字符编码为:UTF-8

The character encoding of file served is: UTF-8

能不能让我知道是否需要更改任何设置来解决此问题?

Can you please let me know if any settings need to be changed to overcome this problem?

提前谢谢!

推荐答案

我在码头8上遇到了类似的问题,并将此行添加到bin/jetty.sh中来解决了该问题:

I had a similar problem with jetty 8 and solved it by adding this line to bin/jetty.sh:

JAVA_OPTIONS+=("-Dfile.encoding=UTF-8")

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

07-27 13:34